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 __LICENSEDLG_HXX__
24 #define __LICENSEDLG_HXX__
25 
26 #include <sal/types.h>
27 #include <rtl/string.hxx>
28 #include <rtl/ustring.hxx>
29 #include <rtl/ustrbuf.hxx>
30 #include <tools/string.hxx>
31 #include <tools/resmgr.hxx>
32 #include <vcl/button.hxx>
33 #include <vcl/edit.hxx>
34 #include <vcl/fixed.hxx>
35 #include <vcl/dialog.hxx>
36 #include <vcl/scrbar.hxx>
37 #include <svtools/svmedit.hxx>
38 #include <svl/lstner.hxx>
39 
40 namespace framework {
41 
42 class LicenseView : public MultiLineEdit, public SfxListener
43 {
44     sal_Bool            mbEndReached;
45     Link            maEndReachedHdl;
46     Link            maScrolledHdl;
47 
48 public:
49     LicenseView( Window* pParent, const ResId& rResId );
50     ~LicenseView();
51 
52     void ScrollDown( ScrollType eScroll );
53 
54     sal_Bool IsEndReached() const;
EndReached() const55     sal_Bool EndReached() const { return mbEndReached; }
SetEndReached(sal_Bool bEnd)56     void SetEndReached( sal_Bool bEnd ) { mbEndReached = bEnd; }
57 
SetEndReachedHdl(const Link & rHdl)58     void SetEndReachedHdl( const Link& rHdl )  { maEndReachedHdl = rHdl; }
GetAutocompleteHdl() const59     const Link& GetAutocompleteHdl() const { return maEndReachedHdl; }
60 
SetScrolledHdl(const Link & rHdl)61     void SetScrolledHdl( const Link& rHdl )  { maScrolledHdl = rHdl; }
GetScrolledHdl() const62     const Link& GetScrolledHdl() const { return maScrolledHdl; }
63 
64     using MultiLineEdit::Notify;
65     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint );
66 };
67 
68 class LicenseDialog : public ModalDialog
69 {
70     LicenseView     aLicenseML;
71     FixedText       aInfo1FT;
72     FixedText       aInfo2FT;
73     FixedText       aInfo3FT;
74     FixedText       aInfo2_1FT;
75     FixedText       aInfo3_1FT;
76     FixedLine       aFixedLine;
77     PushButton      aPBPageDown;
78     PushButton      aPBDecline;
79     PushButton      aPBAccept;
80     FixedImage      aArrow;
81     String          aStrAccept;
82     String          aStrNotAccept;
83     String          aOldCancelText;
84     sal_Bool            bEndReached;
85 
86     void                EnableControls();
87 
88     DECL_LINK(          PageDownHdl, PushButton * );
89     DECL_LINK(          EndReachedHdl, LicenseView * );
90     DECL_LINK(          ScrolledHdl, LicenseView * );
91     DECL_LINK(          AcceptBtnHdl, PushButton * );
92     DECL_LINK(          DeclineBtnHdl, PushButton * );
93 
94     public:
95         LicenseDialog(const rtl::OUString& aLicense, ResMgr *pResMgr);
96         virtual ~LicenseDialog();
97 
98 };
99 }
100 #endif
101