xref: /AOO41X/main/sc/source/ui/inc/scuitphfedit.hxx (revision 707fc0d4d52eb4f69d89a98ffec6918ca5de6326)
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 SCUI_TPHFEDIT_HXX
25 #define SCUI_TPHFEDIT_HXX
26 
27 #include "tphfedit.hxx"
28 
29 //===================================================================
30 enum ScHFEntryId
31 {
32     eNoneEntry  ,
33     ePageEntry  ,
34     ePagesEntry ,
35     eSheetEntry ,
36     eConfidentialEntry ,
37     eFileNamePageEntry ,
38     eExtFileNameEntry ,
39     ePageSheetEntry  ,
40     ePageFileNameEntry  ,
41     ePageExtFileNameEntry  ,
42     eUserNameEntry  ,
43     eCreatedByEntry ,
44     eEntryCount
45 };
46 
47 class ScHeaderEditEngine;
48 class ScPatternAttr;
49 class EditView;
50 class EditTextObject;
51 class SvxFieldItem;
52 class ScAccessibleEditObject;
53 
54 
55 class ScHFEditPage : public SfxTabPage
56 {
57 public:
58     virtual sal_Bool    FillItemSet ( SfxItemSet& rCoreSet );
59     virtual void    Reset       ( const SfxItemSet& rCoreSet );
60 
61     void            SetNumType(SvxNumType eNumType);
62     void            ClearTextAreas();
63 
64 protected:
65                 ScHFEditPage( Window*           pParent,
66                               sal_uInt16            nResId,
67                               const SfxItemSet& rCoreSet,
68                               sal_uInt16            nWhich, bool bHeader );
69     virtual     ~ScHFEditPage();
70 
71 private:
72     FixedText       aFtLeft;
73     ScEditWindow    aWndLeft;
74     FixedText       aFtCenter;
75     ScEditWindow    aWndCenter;
76     FixedText       aFtRight;
77     ScEditWindow    aWndRight;
78     FixedText       maFtDefinedHF;
79         ListBox                 maLbDefined;
80     FixedText       maFtCustomHF;
81     ImageButton     aBtnText;
82     ScExtIButton    aBtnFile;
83     ImageButton     aBtnTable;
84     ImageButton     aBtnPage;
85     ImageButton     aBtnLastPage;
86     ImageButton     aBtnDate;
87     ImageButton     aBtnTime;
88     FixedLine       aFlInfo;
89     FixedInfo       aFtInfo;
90     ScPopupMenu     aPopUpFile;
91 
92     sal_uInt16          nWhich;
93     String          aCmdArr[6];
94 
95 private:
96 #ifdef _TPHFEDIT_CXX
97     void FillCmdArr();
98     void InitPreDefinedList();
99     void ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling = false);
100     void InsertToDefinedList();
101     void RemoveFromDefinedList();
102     void SetSelectDefinedList();
103     bool IsPageEntry(EditEngine*pEngine, EditTextObject* pTextObj);
104     bool IsDateEntry(EditTextObject* pTextObj);
105     bool IsExtFileNameEntry(EditTextObject* pTextObj);
106     DECL_LINK( ListHdl_Impl, ListBox* );
107     DECL_LINK( ClickHdl, ImageButton* );
108     DECL_LINK( MenuHdl, ScExtIButton* );
109 #endif
110 };
111 
112 //===================================================================
113 
114 class ScRightHeaderEditPage : public ScHFEditPage
115 {
116 public:
117     static SfxTabPage*  Create( Window* pParent, const SfxItemSet& rCoreSet );
118     static sal_uInt16*      GetRanges();
119 
120 private:
121     ScRightHeaderEditPage( Window* pParent, const SfxItemSet& rSet );
122 };
123 
124 //===================================================================
125 
126 class ScLeftHeaderEditPage : public ScHFEditPage
127 {
128 public:
129     static SfxTabPage*  Create( Window* pParent, const SfxItemSet& rCoreSet );
130     static sal_uInt16*      GetRanges();
131 
132 private:
133     ScLeftHeaderEditPage( Window* pParent, const SfxItemSet& rSet );
134 };
135 
136 //===================================================================
137 
138 class ScRightFooterEditPage : public ScHFEditPage
139 {
140 public:
141     static SfxTabPage*  Create( Window* pParent, const SfxItemSet& rCoreSet );
142     static sal_uInt16*      GetRanges();
143 
144 private:
145     ScRightFooterEditPage( Window* pParent, const SfxItemSet& rSet );
146 };
147 
148 //===================================================================
149 
150 class ScLeftFooterEditPage : public ScHFEditPage
151 {
152 public:
153     static SfxTabPage*  Create( Window* pParent, const SfxItemSet& rCoreSet );
154     static sal_uInt16*      GetRanges();
155 
156 private:
157     ScLeftFooterEditPage( Window* pParent, const SfxItemSet& rSet );
158 };
159 
160 #endif
161 
162