xref: /trunk/main/sw/source/ui/inc/swcont.hxx (revision 1d2dbeb0)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SWCONT_HXX
25 #define _SWCONT_HXX
26 
27 #include <tools/string.hxx>
28 
29 class SwContentType;
30 
31 //Reihenfolge und Anzahl mit ResIds abgleichen!!
32 #define CONTENT_TYPE_OUTLINE		0
33 #define CONTENT_TYPE_TABLE 			1
34 #define CONTENT_TYPE_FRAME          2
35 #define CONTENT_TYPE_GRAPHIC        3
36 #define CONTENT_TYPE_OLE            4
37 #define CONTENT_TYPE_BOOKMARK       5
38 #define CONTENT_TYPE_REGION         6
39 #define CONTENT_TYPE_URLFIELD		7
40 #define CONTENT_TYPE_REFERENCE      8
41 #define CONTENT_TYPE_INDEX			9
42 #define CONTENT_TYPE_POSTIT			10
43 #define CONTENT_TYPE_DRAWOBJECT     11
44 #define CONTENT_TYPE_MAX 			CONTENT_TYPE_DRAWOBJECT +1
45 
46 
47 // Typen fuer das Globaldokument
48 #define GLOBAL_CONTENT_REGION		100
49 #define GLOBAL_CONTENT_INDEX        101
50 #define GLOBAL_CONTENT_TEXT        	102
51 #define GLOBAL_CONTENT_MAX			3
52 
53 // Strings fuer Kontextmenue
54 #define CONTEXT_COUNT 	12
55 #define GLOBAL_CONTEXT_COUNT 14
56 
57 // Modi fuer Drag 'n Drop
58 #define REGION_MODE_NONE    	0
59 #define REGION_MODE_LINK        1
60 #define REGION_MODE_EMBEDDED    2
61 
62 //----------------------------------------------------------------------------
63 //----------------------------------------------------------------------------
64 
65 //mini rtti
66 class SwTypeNumber
67 {
68 	sal_uInt8 nTypeId;
69 
70 	public:
SwTypeNumber(sal_uInt8 nId)71 		SwTypeNumber(sal_uInt8 nId) :nTypeId(nId){}
72 		virtual ~SwTypeNumber();
73 
74 		virtual sal_uInt8	GetTypeId();
75 };
76 //----------------------------------------------------------------------------
77 
78 class SwContent : public SwTypeNumber
79 {
80 	const SwContentType*  	pParent;
81 	String 					sContentName;
82 	long					nYPosition;
83 	sal_Bool					bInvisible;
84 public:
85 		SwContent(const SwContentType* pCnt, const String& rName, long nYPos );
86 
87 	virtual sal_Bool			IsProtect() const;
GetParent() const88 	const SwContentType* 	GetParent() const {return pParent;}
GetName() const89 	const String&			GetName() 	const {return sContentName;}
operator ==(const SwContent &) const90 	int						operator==(const SwContent& /*rCont*/) const
91 								{
92 									//gleich sind sie nie, sonst fallen sie aus dem Array
93 									return sal_False;
94 								}
operator <(const SwContent & rCont) const95 	int						operator<(const SwContent& rCont) const
96 								{
97 									//zuerst nach Position dann nach Name sortieren
98 									return nYPosition != rCont.nYPosition ?
99 										nYPosition < rCont.nYPosition :
100 											sContentName < rCont.sContentName;;
101 								}
102 
GetYPos() const103 	long		GetYPos() const {return nYPosition;}
104 
IsInvisible() const105 	sal_Bool		IsInvisible() const {return bInvisible;}
SetInvisible()106 	void		SetInvisible(){ bInvisible = sal_True;}
107 };
108 
109 #endif
110