xref: /aoo4110/main/sc/source/ui/inc/scuitphfedit.hxx (revision b1cdbd2c)
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 	DECL_LINK( ObjectSelectHdl, ScEditWindow* );
95 
96 private:
97 #ifdef _TPHFEDIT_CXX
98 	void FillCmdArr();
99 	void InitPreDefinedList();
100 	void ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling = false);
101 	void InsertToDefinedList();
102 	void RemoveFromDefinedList();
103 	void SetSelectDefinedList();
104 	bool IsPageEntry(EditEngine*pEngine, EditTextObject* pTextObj);
105 	bool IsDateEntry(EditTextObject* pTextObj);
106 	bool IsExtFileNameEntry(EditTextObject* pTextObj);
107 	DECL_LINK( ListHdl_Impl, ListBox* );
108 	DECL_LINK( ClickHdl, ImageButton* );
109 	DECL_LINK( MenuHdl, ScExtIButton* );
110 #endif
111 };
112 
113 //===================================================================
114 
115 class ScRightHeaderEditPage : public ScHFEditPage
116 {
117 public:
118 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rCoreSet );
119 	static sal_uInt16*		GetRanges();
120 
121 private:
122 	ScRightHeaderEditPage( Window* pParent, const SfxItemSet& rSet );
123 };
124 
125 //===================================================================
126 
127 class ScLeftHeaderEditPage : public ScHFEditPage
128 {
129 public:
130 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rCoreSet );
131 	static sal_uInt16*		GetRanges();
132 
133 private:
134 	ScLeftHeaderEditPage( Window* pParent, const SfxItemSet& rSet );
135 };
136 
137 //===================================================================
138 
139 class ScRightFooterEditPage : public ScHFEditPage
140 {
141 public:
142 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rCoreSet );
143 	static sal_uInt16*		GetRanges();
144 
145 private:
146 	ScRightFooterEditPage( Window* pParent, const SfxItemSet& rSet );
147 };
148 
149 //===================================================================
150 
151 class ScLeftFooterEditPage : public ScHFEditPage
152 {
153 public:
154 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rCoreSet );
155 	static sal_uInt16*		GetRanges();
156 
157 private:
158 	ScLeftFooterEditPage( Window* pParent, const SfxItemSet& rSet );
159 };
160 
161 #endif
162 
163