Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef _SWCONT_HXX
21 : #define _SWCONT_HXX
22 :
23 : #include <tools/string.hxx>
24 :
25 : class SwContentType;
26 :
27 : // synchronize order and number with ResIds!!
28 : #define CONTENT_TYPE_OUTLINE 0
29 : #define CONTENT_TYPE_TABLE 1
30 : #define CONTENT_TYPE_FRAME 2
31 : #define CONTENT_TYPE_GRAPHIC 3
32 : #define CONTENT_TYPE_OLE 4
33 : #define CONTENT_TYPE_BOOKMARK 5
34 : #define CONTENT_TYPE_REGION 6
35 : #define CONTENT_TYPE_URLFIELD 7
36 : #define CONTENT_TYPE_REFERENCE 8
37 : #define CONTENT_TYPE_INDEX 9
38 : #define CONTENT_TYPE_POSTIT 10
39 : #define CONTENT_TYPE_DRAWOBJECT 11
40 : #define CONTENT_TYPE_MAX CONTENT_TYPE_DRAWOBJECT +1
41 :
42 : // types for global document
43 : #define GLOBAL_CONTENT_TEXT 102
44 :
45 : // strings for context menus
46 : #define CONTEXT_COUNT 12
47 : #define GLOBAL_CONTEXT_COUNT 14
48 :
49 : // modes for Drag 'n Drop
50 : #define REGION_MODE_NONE 0
51 : #define REGION_MODE_LINK 1
52 : #define REGION_MODE_EMBEDDED 2
53 :
54 : //----------------------------------------------------------------------------
55 : //----------------------------------------------------------------------------
56 :
57 : //mini rtti
58 : class SwTypeNumber
59 : {
60 : sal_uInt8 nTypeId;
61 :
62 : public:
63 0 : SwTypeNumber(sal_uInt8 nId) :nTypeId(nId){}
64 : virtual ~SwTypeNumber();
65 :
66 : sal_uInt8 GetTypeId() const;
67 : };
68 : //----------------------------------------------------------------------------
69 :
70 0 : class SwContent : public SwTypeNumber
71 : {
72 : const SwContentType* pParent;
73 : String sContentName;
74 : long nYPosition;
75 : sal_Bool bInvisible;
76 : public:
77 : SwContent(const SwContentType* pCnt, const String& rName, long nYPos );
78 :
79 : virtual sal_Bool IsProtect() const;
80 0 : const SwContentType* GetParent() const {return pParent;}
81 0 : const String& GetName() const {return sContentName;}
82 : int operator==(const SwContent& /*rCont*/) const
83 : {
84 : // they're never equal, otherwise they'd fall out of the array
85 : return sal_False;
86 : }
87 0 : int operator<(const SwContent& rCont) const
88 : {
89 : // at first sort by position and then by name
90 : return nYPosition != rCont.nYPosition ?
91 : nYPosition < rCont.nYPosition :
92 0 : sContentName < rCont.sContentName;
93 : }
94 :
95 0 : long GetYPos() const {return nYPosition;}
96 :
97 0 : sal_Bool IsInvisible() const {return bInvisible;}
98 0 : void SetInvisible(){ bInvisible = sal_True;}
99 : };
100 :
101 : #endif
102 :
103 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|