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 EXTENSIONS_ABP_TYPESELECTIONPAGE_HXX
25 #define EXTENSIONS_ABP_TYPESELECTIONPAGE_HXX
26 
27 #include "abspage.hxx"
28 #include "addresssettings.hxx"
29 #include <vcl/edit.hxx>
30 
31 //.........................................................................
32 namespace abp
33 {
34 //.........................................................................
35 
36 	//=====================================================================
37 	//= TypeSelectionPage
38 	//=====================================================================
39 	class TypeSelectionPage : public AddressBookSourcePage
40 	{
41 	protected:
42 		FixedText		m_aHint;
43 		FixedLine		m_aTypeSep;
44 		RadioButton		m_aEvolution;
45 		RadioButton		m_aEvolutionGroupwise;
46 		RadioButton		m_aEvolutionLdap;
47 		RadioButton		m_aMORK;
48 		RadioButton		m_aThunderbird;
49 		RadioButton		m_aKab;
50 		RadioButton		m_aMacab;
51 		RadioButton		m_aLDAP;
52 		RadioButton		m_aOutlook;
53 		RadioButton		m_aOE;
54 		RadioButton		m_aOther;
55 
56 		struct ButtonItem {
57 			RadioButton *m_pItem;
58 			AddressSourceType m_eType;
59 			bool         m_bVisible;
60 
ButtonItemabp::TypeSelectionPage::ButtonItem61 			ButtonItem( RadioButton *pItem,
62 						AddressSourceType eType,
63 						bool         bVisible ) :
64 					m_pItem( pItem ),
65 					m_eType( eType ),
66 					m_bVisible( bVisible )
67 			{}
68 		};
69 
70 		::std::vector< ButtonItem > m_aAllTypes;
71 
72 	public:
73 		TypeSelectionPage( OAddessBookSourcePilot* _pParent );
74         ~TypeSelectionPage();
75 
76         // retrieves the currently selected type
77         AddressSourceType   getSelectedType() const;
78 
79 	protected:
80 		// OWizardPage overridables
81 		virtual void		initializePage();
82 		virtual sal_Bool	commitPage( ::svt::WizardTypes::CommitPageReason _eReason );
83 
84 		// TabDialog overridables
85 		virtual void		ActivatePage();
86 		virtual void		DeactivatePage();
87 
88 		// OImportPage overridables
89 		virtual bool        canAdvance() const;
90 
91 	private:
92 		DECL_LINK( OnTypeSelected, void* );
93 
94 		void				selectType( AddressSourceType _eType );
95 	};
96 
97 //.........................................................................
98 }	// namespace abp
99 //.........................................................................
100 
101 #endif // EXTENSIONS_ABP_TYPESELECTIONPAGE_HXX
102 
103