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 INCLUDED_SW_SOURCE_UI_INC_SWCONT_HXX
21 : #define INCLUDED_SW_SOURCE_UI_INC_SWCONT_HXX
22 :
23 : #include <rtl/ustring.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 : //mini rtti
55 : class SwTypeNumber
56 : {
57 : sal_uInt8 nTypeId;
58 :
59 : public:
60 0 : SwTypeNumber(sal_uInt8 nId) :nTypeId(nId){}
61 : virtual ~SwTypeNumber();
62 :
63 : sal_uInt8 GetTypeId() const;
64 : };
65 :
66 0 : class SwContent : public SwTypeNumber
67 : {
68 : const SwContentType* pParent;
69 : OUString sContentName;
70 : long nYPosition;
71 : sal_Bool bInvisible;
72 : public:
73 : SwContent(const SwContentType* pCnt, const OUString& rName, long nYPos );
74 :
75 : virtual sal_Bool IsProtect() const;
76 0 : const SwContentType* GetParent() const {return pParent;}
77 0 : const OUString& GetName() const {return sContentName;}
78 : int operator==(const SwContent& /*rCont*/) const
79 : {
80 : // they're never equal, otherwise they'd fall out of the array
81 : return sal_False;
82 : }
83 0 : bool operator<(const SwContent& rCont) const
84 : {
85 : // at first sort by position and then by name
86 0 : return nYPosition != rCont.nYPosition ?
87 0 : nYPosition < rCont.nYPosition :
88 0 : sContentName < rCont.sContentName;
89 : }
90 :
91 0 : long GetYPos() const {return nYPosition;}
92 :
93 0 : sal_Bool IsInvisible() const {return bInvisible;}
94 0 : void SetInvisible(){ bInvisible = sal_True;}
95 : };
96 :
97 : #endif
98 :
99 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|