Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef _SWCONT_HXX
30 : : #define _SWCONT_HXX
31 : :
32 : : #include <tools/string.hxx>
33 : :
34 : : class SwContentType;
35 : :
36 : : // synchronize order and number with ResIds!!
37 : : #define CONTENT_TYPE_OUTLINE 0
38 : : #define CONTENT_TYPE_TABLE 1
39 : : #define CONTENT_TYPE_FRAME 2
40 : : #define CONTENT_TYPE_GRAPHIC 3
41 : : #define CONTENT_TYPE_OLE 4
42 : : #define CONTENT_TYPE_BOOKMARK 5
43 : : #define CONTENT_TYPE_REGION 6
44 : : #define CONTENT_TYPE_URLFIELD 7
45 : : #define CONTENT_TYPE_REFERENCE 8
46 : : #define CONTENT_TYPE_INDEX 9
47 : : #define CONTENT_TYPE_POSTIT 10
48 : : #define CONTENT_TYPE_DRAWOBJECT 11
49 : : #define CONTENT_TYPE_MAX CONTENT_TYPE_DRAWOBJECT +1
50 : :
51 : : // types for global document
52 : : #define GLOBAL_CONTENT_TEXT 102
53 : :
54 : : // strings for context menus
55 : : #define CONTEXT_COUNT 12
56 : : #define GLOBAL_CONTEXT_COUNT 14
57 : :
58 : : // modes for Drag 'n Drop
59 : : #define REGION_MODE_NONE 0
60 : : #define REGION_MODE_LINK 1
61 : : #define REGION_MODE_EMBEDDED 2
62 : :
63 : : //----------------------------------------------------------------------------
64 : : //----------------------------------------------------------------------------
65 : :
66 : : //mini rtti
67 : : class SwTypeNumber
68 : : {
69 : : sal_uInt8 nTypeId;
70 : :
71 : : public:
72 : 0 : SwTypeNumber(sal_uInt8 nId) :nTypeId(nId){}
73 : : virtual ~SwTypeNumber();
74 : :
75 : : virtual sal_uInt8 GetTypeId();
76 : : };
77 : : //----------------------------------------------------------------------------
78 : :
79 [ # # ][ # # ]: 0 : class SwContent : public SwTypeNumber
80 : : {
81 : : const SwContentType* pParent;
82 : : String sContentName;
83 : : long nYPosition;
84 : : sal_Bool bInvisible;
85 : : public:
86 : : SwContent(const SwContentType* pCnt, const String& rName, long nYPos );
87 : :
88 : : virtual sal_Bool IsProtect() const;
89 : 0 : const SwContentType* GetParent() const {return pParent;}
90 : 0 : const String& GetName() const {return sContentName;}
91 : : int operator==(const SwContent& /*rCont*/) const
92 : : {
93 : : // they're never equal, otherwise they'd fall out of the array
94 : : return sal_False;
95 : : }
96 : 0 : int operator<(const SwContent& rCont) const
97 : : {
98 : : // at first sort by position and then by name
99 : : return nYPosition != rCont.nYPosition ?
100 : : nYPosition < rCont.nYPosition :
101 [ # # ]: 0 : sContentName < rCont.sContentName;
102 : : }
103 : :
104 : 0 : long GetYPos() const {return nYPosition;}
105 : :
106 : 0 : sal_Bool IsInvisible() const {return bInvisible;}
107 : 0 : void SetInvisible(){ bInvisible = sal_True;}
108 : : };
109 : :
110 : : #endif
111 : :
112 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|