1*46dbaceeSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*46dbaceeSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*46dbaceeSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*46dbaceeSAndrew Rist  * distributed with this work for additional information
6*46dbaceeSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*46dbaceeSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*46dbaceeSAndrew Rist  * "License"); you may not use this file except in compliance
9*46dbaceeSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*46dbaceeSAndrew Rist  *
11*46dbaceeSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*46dbaceeSAndrew Rist  *
13*46dbaceeSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*46dbaceeSAndrew Rist  * software distributed under the License is distributed on an
15*46dbaceeSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*46dbaceeSAndrew Rist  * KIND, either express or implied.  See the License for the
17*46dbaceeSAndrew Rist  * specific language governing permissions and limitations
18*46dbaceeSAndrew Rist  * under the License.
19*46dbaceeSAndrew Rist  *
20*46dbaceeSAndrew Rist  *************************************************************/
21*46dbaceeSAndrew Rist 
22*46dbaceeSAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir #ifndef _EXTENSIONS_PRELOAD_OEMWIZ_HXX_
25cdf0e10cSrcweir #define _EXTENSIONS_PRELOAD_OEMWIZ_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
28cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
29cdf0e10cSrcweir #include <svtools/wizdlg.hxx>
30cdf0e10cSrcweir #ifndef _SV_BUTTON_HXX
31cdf0e10cSrcweir #include <vcl/button.hxx>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #include <vcl/tabpage.hxx>
34cdf0e10cSrcweir #include <vcl/fixed.hxx>
35cdf0e10cSrcweir #include <svtools/svmedit.hxx>
36cdf0e10cSrcweir #include <svl/lstner.hxx>
37cdf0e10cSrcweir #include <vcl/scrbar.hxx>
38cdf0e10cSrcweir 
39cdf0e10cSrcweir //.........................................................................
40cdf0e10cSrcweir namespace preload
41cdf0e10cSrcweir {
42cdf0e10cSrcweir     #define OEM_WELCOME     0
43cdf0e10cSrcweir     #define OEM_LICENSE     1
44cdf0e10cSrcweir     #define OEM_USERDATA    2
45cdf0e10cSrcweir 
46cdf0e10cSrcweir //.........................................................................
47cdf0e10cSrcweir     //=====================================================================
48cdf0e10cSrcweir     //= OEMPreloadDialog
49cdf0e10cSrcweir 	//=====================================================================
50cdf0e10cSrcweir     struct OEMPreloadDialog_Impl;
51cdf0e10cSrcweir     class OEMPreloadDialog : public WizardDialog
52cdf0e10cSrcweir 	{
53cdf0e10cSrcweir         PushButton      aPrevPB;
54cdf0e10cSrcweir         PushButton      aNextPB;
55cdf0e10cSrcweir         CancelButton    aCancelPB;
56cdf0e10cSrcweir 
57cdf0e10cSrcweir         String          aNextST;
58cdf0e10cSrcweir         String          aAcceptST;
59cdf0e10cSrcweir         String          aFinishST;
60cdf0e10cSrcweir         String          aDlgTitle;
61cdf0e10cSrcweir         String          aLicense;
62cdf0e10cSrcweir         String          aUserData;
63cdf0e10cSrcweir         OEMPreloadDialog_Impl* pImpl;
64cdf0e10cSrcweir 
65cdf0e10cSrcweir         DECL_LINK(NextPrevPageHdl, PushButton*);
66cdf0e10cSrcweir     protected:
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 	public:
69cdf0e10cSrcweir         OEMPreloadDialog(
70cdf0e10cSrcweir 			Window* _pParent,
71cdf0e10cSrcweir 			const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& _rxObjectModel,
72cdf0e10cSrcweir 			const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
73cdf0e10cSrcweir 		);
74cdf0e10cSrcweir         ~OEMPreloadDialog();
75cdf0e10cSrcweir 
GetAcceptString() const76cdf0e10cSrcweir         const String&   GetAcceptString()const {return aAcceptST;}
GetCancelString() const77cdf0e10cSrcweir         const String    GetCancelString() const {return aCancelPB.GetText();}
78cdf0e10cSrcweir         void            SetCancelString( const String& rText );
79cdf0e10cSrcweir 
80cdf0e10cSrcweir         static sal_Bool LoadFromLocalFile(const String& rFileName, String& rContent);
81cdf0e10cSrcweir     };
82cdf0e10cSrcweir     class OEMWelcomeTabPage : public TabPage
83cdf0e10cSrcweir     {
84cdf0e10cSrcweir         FixedText   aInfoFT;
85cdf0e10cSrcweir         public:
86cdf0e10cSrcweir             OEMWelcomeTabPage(Window* pParent);
87cdf0e10cSrcweir             ~OEMWelcomeTabPage();
88cdf0e10cSrcweir     };
89cdf0e10cSrcweir     class LicenceView : public MultiLineEdit, public SfxListener
90cdf0e10cSrcweir     {
91cdf0e10cSrcweir         sal_Bool            mbEndReached;
92cdf0e10cSrcweir         Link            maEndReachedHdl;
93cdf0e10cSrcweir         Link            maScrolledHdl;
94cdf0e10cSrcweir 
95cdf0e10cSrcweir     public:
96cdf0e10cSrcweir                         LicenceView( Window* pParent, const ResId& rResId );
97cdf0e10cSrcweir                        ~LicenceView();
98cdf0e10cSrcweir 
99cdf0e10cSrcweir         void            ScrollDown( ScrollType eScroll );
100cdf0e10cSrcweir 
101cdf0e10cSrcweir         sal_Bool            IsEndReached() const;
EndReached() const102cdf0e10cSrcweir         sal_Bool            EndReached() const { return mbEndReached; }
SetEndReached(sal_Bool bEnd)103cdf0e10cSrcweir         void            SetEndReached( sal_Bool bEnd ) { mbEndReached = bEnd; }
104cdf0e10cSrcweir 
SetEndReachedHdl(const Link & rHdl)105cdf0e10cSrcweir         void            SetEndReachedHdl( const Link& rHdl )  { maEndReachedHdl = rHdl; }
GetAutocompleteHdl() const106cdf0e10cSrcweir         const Link&     GetAutocompleteHdl() const { return maEndReachedHdl; }
107cdf0e10cSrcweir 
SetScrolledHdl(const Link & rHdl)108cdf0e10cSrcweir         void            SetScrolledHdl( const Link& rHdl )  { maScrolledHdl = rHdl; }
GetScrolledHdl() const109cdf0e10cSrcweir         const Link&     GetScrolledHdl() const { return maScrolledHdl; }
110cdf0e10cSrcweir 
111cdf0e10cSrcweir         virtual void    Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
112cdf0e10cSrcweir     private:
113cdf0e10cSrcweir         using MultiLineEdit::Notify;
114cdf0e10cSrcweir     };
115cdf0e10cSrcweir     class OEMLicenseTabPage : public TabPage
116cdf0e10cSrcweir     {
117cdf0e10cSrcweir         LicenceView     aLicenseML;
118cdf0e10cSrcweir         FixedText       aInfo1FT;
119cdf0e10cSrcweir         FixedText       aInfo2FT;
120cdf0e10cSrcweir         FixedText       aInfo3FT;
121cdf0e10cSrcweir         FixedText       aInfo2_1FT;
122cdf0e10cSrcweir         FixedText       aInfo3_1FT;
123cdf0e10cSrcweir         CheckBox        aCBAccept;
124cdf0e10cSrcweir         PushButton      aPBPageDown;
125cdf0e10cSrcweir         FixedImage      aArrow;
126cdf0e10cSrcweir         String          aStrAccept;
127cdf0e10cSrcweir         String          aStrNotAccept;
128cdf0e10cSrcweir         String          aOldCancelText;
129cdf0e10cSrcweir         sal_Bool            bEndReached;
130cdf0e10cSrcweir 
131cdf0e10cSrcweir         OEMPreloadDialog* pPreloadDialog;
132cdf0e10cSrcweir 
133cdf0e10cSrcweir         void                EnableControls();
134cdf0e10cSrcweir 
135cdf0e10cSrcweir         DECL_LINK(          AcceptHdl, CheckBox * );
136cdf0e10cSrcweir         DECL_LINK(          PageDownHdl, PushButton * );
137cdf0e10cSrcweir         DECL_LINK(          EndReachedHdl, LicenceView * );
138cdf0e10cSrcweir         DECL_LINK(          ScrolledHdl, LicenceView * );
139cdf0e10cSrcweir 
140cdf0e10cSrcweir         public:
141cdf0e10cSrcweir             OEMLicenseTabPage(OEMPreloadDialog* pParent);
142cdf0e10cSrcweir             ~OEMLicenseTabPage();
143cdf0e10cSrcweir 
144cdf0e10cSrcweir             virtual void ActivatePage();
145cdf0e10cSrcweir     };
146cdf0e10cSrcweir 
147cdf0e10cSrcweir //.........................................................................
148cdf0e10cSrcweir }   // namespace preload
149cdf0e10cSrcweir //.........................................................................
150cdf0e10cSrcweir 
151cdf0e10cSrcweir #endif // _EXTENSIONS_PRELOAD_OEMWIZ_HXX_
152cdf0e10cSrcweir 
153