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 INCLUDED_unotools_USEROPTIONS_HXX
24 #define INCLUDED_unotools_USEROPTIONS_HXX
25 
26 #include "unotools/unotoolsdllapi.h"
27 #include <unotools/configitem.hxx>
28 #include <tools/string.hxx>
29 #include <osl/mutex.hxx>
30 #include <unotools/options.hxx>
31 
32 // define ----------------------------------------------------------------
33 
34 #define USER_OPT_CITY				((sal_uInt16)0)
35 #define USER_OPT_COMPANY			((sal_uInt16)1)
36 #define USER_OPT_COUNTRY			((sal_uInt16)2)
37 #define USER_OPT_EMAIL				((sal_uInt16)3)
38 #define USER_OPT_FAX				((sal_uInt16)4)
39 #define USER_OPT_FIRSTNAME			((sal_uInt16)5)
40 #define USER_OPT_LASTNAME			((sal_uInt16)6)
41 #define USER_OPT_POSITION			((sal_uInt16)7)
42 #define USER_OPT_STATE				((sal_uInt16)8)
43 #define USER_OPT_STREET				((sal_uInt16)9)
44 #define USER_OPT_TELEPHONEHOME		((sal_uInt16)10)
45 #define USER_OPT_TELEPHONEWORK		((sal_uInt16)11)
46 #define USER_OPT_TITLE				((sal_uInt16)12)
47 #define USER_OPT_ID					((sal_uInt16)13)
48 #define USER_OPT_ZIP				((sal_uInt16)14)
49 #define USER_OPT_FATHERSNAME        ((sal_uInt16)15)
50 #define USER_OPT_APARTMENT          ((sal_uInt16)16)
51 
52 // class SvtUserOptions --------------------------------------------------
53 
54 class SvtUserOptions_Impl;
55 
56 class UNOTOOLS_DLLPUBLIC SvtUserOptions: public utl::detail::Options
57 {
58 private:
59 	SvtUserOptions_Impl*	pImp;
60 
61 public:
62 	SvtUserOptions();
63 	virtual ~SvtUserOptions();
64 
65 	static ::osl::Mutex&	GetInitMutex();
66 
67     // get the address token
68 	 ::rtl::OUString	GetCompany() const;
69 	 ::rtl::OUString	GetFirstName() const;
70 	 ::rtl::OUString	GetLastName() const;
71 	 ::rtl::OUString	GetID() const;
72 	 ::rtl::OUString	GetStreet() const;
73 	 ::rtl::OUString	GetCity() const;
74 	 ::rtl::OUString	GetState() const;
75 	 ::rtl::OUString	GetZip() const;
76 	 ::rtl::OUString	GetCountry() const;
77 	 ::rtl::OUString	GetPosition() const;
78 	 ::rtl::OUString	GetTitle() const;
79 	 ::rtl::OUString	GetTelephoneHome() const;
80 	 ::rtl::OUString	GetTelephoneWork() const;
81 	 ::rtl::OUString	GetFax() const;
82 	 ::rtl::OUString	GetEmail() const;
83 	 ::rtl::OUString	GetCustomerNumber() const;
84      ::rtl::OUString    GetFathersName() const;
85      ::rtl::OUString    GetApartment() const;
86 
87 	 ::rtl::OUString	GetFullName() const;
88 	 ::rtl::OUString	GetLocale() const;
89 
90 	// set the address token
91 	void			SetCompany( const ::rtl::OUString& rNewToken );
92 	void			SetFirstName( const ::rtl::OUString& rNewToken );
93 	void			SetLastName( const ::rtl::OUString& rNewToken );
94 	void			SetID( const ::rtl::OUString& rNewToken );
95 	void			SetStreet( const ::rtl::OUString& rNewToken );
96 	void			SetCity( const ::rtl::OUString& rNewToken );
97 	void			SetState( const ::rtl::OUString& rNewToken );
98 	void			SetZip( const ::rtl::OUString& rNewToken );
99 	void			SetCountry( const ::rtl::OUString& rNewToken );
100 	void			SetPosition( const ::rtl::OUString& rNewToken );
101 	void			SetTitle( const ::rtl::OUString& rNewToken );
102 	void			SetTelephoneHome( const ::rtl::OUString& rNewToken );
103 	void			SetTelephoneWork( const ::rtl::OUString& rNewToken );
104 	void			SetFax( const ::rtl::OUString& rNewToken );
105 	void			SetEmail( const ::rtl::OUString& rNewToken );
106 	void			SetCustomerNumber( const ::rtl::OUString& rNewToken );
107     void            SetFathersName( const ::rtl::OUString& rNewToken );
108     void            SetApartment( const ::rtl::OUString& rNewToken );
109 
110 	sal_Bool		IsTokenReadonly( sal_uInt16 nToken ) const;
111     ::rtl::OUString GetToken(sal_uInt16 nToken) const;
112 };
113 
114 #endif // #ifndef INCLUDED_unotools_USEROPTIONS_HXX
115