xref: /aoo42x/main/cui/source/inc/cuioptgenrl.hxx (revision c4eee24d)
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 #ifndef _SVX_CUIOPTGENRL_HXX
24 #define _SVX_CUIOPTGENRL_HXX
25 
26 // include ---------------------------------------------------------------
27 
28 #include <svx/optgenrl.hxx>
29 #include <sfx2/tabdlg.hxx>
30 #include <vcl/fixed.hxx>
31 #include <vcl/edit.hxx>
32 #include <vcl/group.hxx>
33 
34 // forward ---------------------------------------------------------------
35 
36 struct GeneralTabPage_Impl;
37 
38 #define SfxGeneralTabPage   SvxGeneralTabPage
39 #define INDEX_NOTSET        ((sal_Int16)-1)
40 
41 // class SvxUserEdit -----------------------------------------------------
42 
43 class SvxUserEdit : public Edit
44 {
45 private:
46     sal_Int16   m_nIndex;
47     FixedText*  m_pLabel;
48 
49 public:
SvxUserEdit(Window * pParent,const ResId & rResId,sal_Int16 nIndex=INDEX_NOTSET,FixedText * pLabel=NULL)50     SvxUserEdit( Window* pParent, const ResId& rResId,
51                  sal_Int16 nIndex = INDEX_NOTSET, FixedText* pLabel = NULL ) :
52         Edit( pParent, rResId, true ), m_nIndex( nIndex ), m_pLabel( pLabel ) {}
53 
SetIndex(sal_Int16 nIndex)54     inline void         SetIndex( sal_Int16 nIndex ) { m_nIndex = nIndex; }
GetIndex() const55     inline sal_Int16    GetIndex() const { return m_nIndex; }
SetLabel(FixedText * pLabel)56     inline void         SetLabel( FixedText* pLabel ) { m_pLabel = pLabel; }
GetLabel() const57     inline FixedText*   GetLabel() const { return m_pLabel; }
58 };
59 
60 // class SvxGeneralTabPage -----------------------------------------------
61 
62 class SvxGeneralTabPage : public SfxTabPage
63 {
64 	using TabPage::DeactivatePage;
65 private:
66     FixedLine           aAddrFrm;
67 	FixedText 			aCompanyLbl;
68     SvxUserEdit         aCompanyEdit;
69 	FixedText 			aNameLbl;
70 	FixedText 			aNameLblRuss;
71 	FixedText 			aNameLblEastern;
72     SvxUserEdit         aFirstName;
73     SvxUserEdit         aFatherName;
74     SvxUserEdit         aName;
75     SvxUserEdit         aShortName;
76 	FixedText 			aStreetLbl;
77 	FixedText 			aStreetLblRuss;
78     SvxUserEdit         aStreetEdit;
79     SvxUserEdit         aApartmentNrEdit;
80 	FixedText 			aCityLbl;
81     SvxUserEdit         aPLZEdit;
82     SvxUserEdit         aCityEdit;
83     SvxUserEdit         aUsCityEdit;
84     SvxUserEdit         aUsStateEdit;
85     SvxUserEdit         aUsZipEdit;
86 	FixedText			aCountryLbl;
87     SvxUserEdit         aCountryEdit;
88 	FixedText 			aTitlePosLbl;
89     SvxUserEdit         aTitleEdit;
90     SvxUserEdit         aPositionEdit;
91 	FixedText 			aPhoneLbl;
92     SvxUserEdit         aTelPrivEdit;
93     SvxUserEdit         aTelCompanyEdit;
94 	FixedText 			aFaxMailLbl;
95     SvxUserEdit         aFaxEdit;
96     SvxUserEdit         aEmailEdit;
97 	CheckBox			aUseDataCB;
98 
99 	GeneralTabPage_Impl*	pImpl;
100 
101 #ifdef _SVX_OPTGENRL_CXX
102 	DECL_LINK( ModifyHdl_Impl, Edit * );
103 
104     sal_Bool            GetAddress_Impl();
105     void                SetAddress_Impl();
106 #endif
107 
108 protected:
109 	virtual int			DeactivatePage( SfxItemSet* pSet );
110 
111 public:
112 	SvxGeneralTabPage( Window* pParent, const SfxItemSet& rSet );
113 	~SvxGeneralTabPage();
114 
115 	static SfxTabPage*	Create( Window* pParent, const SfxItemSet& rAttrSet );
116 
117 	virtual	sal_Bool 		FillItemSet( SfxItemSet& rSet );
118 	virtual	void 		Reset( const SfxItemSet& rSet );
119 };
120 
121 #endif // #ifndef _SVX_CUIOPTGENRL_HXX
122 
123 
124