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