xref: /trunk/main/sc/source/ui/inc/scuitphfedit.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 #ifndef SCUI_TPHFEDIT_HXX
29 #define SCUI_TPHFEDIT_HXX
30 
31 #include "tphfedit.hxx"
32 
33 //===================================================================
34 enum ScHFEntryId
35 {
36     eNoneEntry  ,
37     ePageEntry  ,
38     ePagesEntry ,
39     eSheetEntry ,
40     eConfidentialEntry ,
41     eFileNamePageEntry ,
42     eExtFileNameEntry ,
43     ePageSheetEntry  ,
44     ePageFileNameEntry  ,
45     ePageExtFileNameEntry  ,
46     eUserNameEntry  ,
47     eCreatedByEntry ,
48     eEntryCount
49 };
50 
51 class ScHeaderEditEngine;
52 class ScPatternAttr;
53 class EditView;
54 class EditTextObject;
55 class SvxFieldItem;
56 class ScAccessibleEditObject;
57 
58 
59 class ScHFEditPage : public SfxTabPage
60 {
61 public:
62 	virtual	sal_Bool	FillItemSet	( SfxItemSet& rCoreSet );
63 	virtual	void	Reset		( const SfxItemSet& rCoreSet );
64 
65 	void			SetNumType(SvxNumType eNumType);
66 	void			ClearTextAreas();
67 
68 protected:
69 				ScHFEditPage( Window*			pParent,
70 							  sal_uInt16			nResId,
71 							  const SfxItemSet&	rCoreSet,
72 							  sal_uInt16			nWhich, bool bHeader );
73 	virtual		~ScHFEditPage();
74 
75 private:
76 	FixedText		aFtLeft;
77 	ScEditWindow	aWndLeft;
78 	FixedText		aFtCenter;
79 	ScEditWindow	aWndCenter;
80 	FixedText		aFtRight;
81 	ScEditWindow	aWndRight;
82 	FixedText		maFtDefinedHF;
83         ListBox                 maLbDefined;
84 	FixedText		maFtCustomHF;
85 	ImageButton		aBtnText;
86 	ScExtIButton	aBtnFile;
87 	ImageButton		aBtnTable;
88 	ImageButton		aBtnPage;
89 	ImageButton		aBtnLastPage;
90 	ImageButton		aBtnDate;
91 	ImageButton		aBtnTime;
92 	FixedLine		aFlInfo;
93 	FixedInfo		aFtInfo;
94 	ScPopupMenu		aPopUpFile;
95 
96 	sal_uInt16			nWhich;
97 	String			aCmdArr[6];
98 
99 private:
100 #ifdef _TPHFEDIT_CXX
101 	void FillCmdArr();
102 	void InitPreDefinedList();
103 	void ProcessDefinedListSel(ScHFEntryId eSel, bool bTravelling = false);
104 	void InsertToDefinedList();
105 	void RemoveFromDefinedList();
106 	void SetSelectDefinedList();
107 	bool IsPageEntry(EditEngine*pEngine, EditTextObject* pTextObj);
108 	bool IsDateEntry(EditTextObject* pTextObj);
109 	bool IsExtFileNameEntry(EditTextObject* pTextObj);
110 	DECL_LINK( ListHdl_Impl, ListBox* );
111 	DECL_LINK( ClickHdl, ImageButton* );
112 	DECL_LINK( MenuHdl, ScExtIButton* );
113 #endif
114 };
115 
116 //===================================================================
117 
118 class ScRightHeaderEditPage : public ScHFEditPage
119 {
120 public:
121 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rCoreSet );
122 	static sal_uInt16*		GetRanges();
123 
124 private:
125 	ScRightHeaderEditPage( Window* pParent, const SfxItemSet& rSet );
126 };
127 
128 //===================================================================
129 
130 class ScLeftHeaderEditPage : public ScHFEditPage
131 {
132 public:
133 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rCoreSet );
134 	static sal_uInt16*		GetRanges();
135 
136 private:
137 	ScLeftHeaderEditPage( Window* pParent, const SfxItemSet& rSet );
138 };
139 
140 //===================================================================
141 
142 class ScRightFooterEditPage : public ScHFEditPage
143 {
144 public:
145 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rCoreSet );
146 	static sal_uInt16*		GetRanges();
147 
148 private:
149 	ScRightFooterEditPage( Window* pParent, const SfxItemSet& rSet );
150 };
151 
152 //===================================================================
153 
154 class ScLeftFooterEditPage : public ScHFEditPage
155 {
156 public:
157 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rCoreSet );
158 	static sal_uInt16*		GetRanges();
159 
160 private:
161 	ScLeftFooterEditPage( Window* pParent, const SfxItemSet& rSet );
162 };
163 
164 #endif
165 
166