xref: /aoo42x/main/sw/source/ui/inc/unotools.hxx (revision 437a6594)
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 _UNOTOOLS_HXX
24 #define _UNOTOOLS_HXX
25 
26 
27 #include <vcl/dialog.hxx>
28 #include <vcl/fixed.hxx>
29 #include <vcl/edit.hxx>
30 #ifndef _SV_BUTTON_HXX //autogen
31 #include <vcl/button.hxx>
32 #endif
33 #include <actctrl.hxx>
34 #include <com/sun/star/frame/XController.hpp>
35 #include <com/sun/star/text/XTextCursor.hpp>
36 #include <com/sun/star/container/XNameAccess.hpp>
37 #include <com/sun/star/awt/XControl.hpp>
38 #include <com/sun/star/container/XNamed.hpp>
39 #include <tools/resary.hxx>
40 #include <swunodef.hxx>
41 #include "swdllapi.h"
42 
43 /* -----------------------------15.12.99 09:55--------------------------------
44 
45  ---------------------------------------------------------------------------*/
46 class SwOneExampleFrame;
47 class SwFrmCtrlWindow : public Window
48 {
49 	SwOneExampleFrame* 	pExampleFrame;
50 public:
51 	SwFrmCtrlWindow(Window* pParent, WinBits nBits, SwOneExampleFrame* 	pFrame);
52 
53 	virtual void	Command( const CommandEvent& rCEvt );
54 };
55 /* -----------------------------15.12.99 12:56--------------------------------
56 
57  ---------------------------------------------------------------------------*/
58 class MenuResource : public Resource
59 {
60 	ResStringArray		aMenuArray;
61 
62 public:
63 	MenuResource(const ResId& rResId);
64 
GetMenuArray()65 	ResStringArray& GetMenuArray() {return aMenuArray;}
66 };
67 /* -----------------27.07.99 15:20-------------------
68 
69  --------------------------------------------------*/
70 #define EX_SHOW_ONLINE_LAYOUT 	0x001
71 
72 // hard zoom value
73 #define EX_SHOW_BUSINESS_CARDS  0x02
74 //don't modify page size
75 #define EX_SHOW_DEFAULT_PAGE    0x04
76 
77 class SwView;
78 class SW_DLLPUBLIC SwOneExampleFrame
79 {
80     ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl >         _xControl;
81     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >         _xModel;
82     ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >    _xController;
83     ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor >     _xCursor;
84 
85 	SwFrmCtrlWindow	aTopWindow;
86 	Window& 		rWindow;
87 	Timer			aLoadedTimer;
88 	Link			aInitializedLink;
89 
90 	MenuResource	aMenuRes;
91 	String 			sArgumentURL;
92 
93 	SwView* 		pModuleView;
94 
95 	sal_uInt32			nStyleFlags;
96 
97 	sal_Bool			bIsInitialized;
98 	sal_Bool 			bServiceAvailable;
99 
100 	static 	sal_Bool	bShowServiceNotAvailableMessage;
101 
102 	SW_DLLPRIVATE DECL_LINK( TimeoutHdl, Timer* );
103 	SW_DLLPRIVATE DECL_LINK( PopupHdl, Menu* );
104 
105 	SW_DLLPRIVATE void	CreateControl();
106 	SW_DLLPRIVATE void	DisposeControl();
107 
108 public:
109 	SwOneExampleFrame(Window& rWin,
110 					sal_uInt32 nStyleFlags = EX_SHOW_ONLINE_LAYOUT,
111 					const Link* pInitializedLink = 0,
112 					String* pURL = 0);
113 	~SwOneExampleFrame();
114 
STAR_REFERENCE(awt::XControl)115 	STAR_REFERENCE( awt::XControl ) &		GetControl() 	{return _xControl; }
STAR_REFERENCE(frame::XModel)116 	STAR_REFERENCE( frame::XModel ) & 		GetModel() 		{return _xModel;}
STAR_REFERENCE(frame::XController)117 	STAR_REFERENCE( frame::XController ) &	GetController() {return _xController;}
STAR_REFERENCE(text::XTextCursor)118 	STAR_REFERENCE( text::XTextCursor ) &	GetTextCursor() {return _xCursor;}
119 
120 	void ClearDocument( sal_Bool bStartTimer = sal_False );
121 
IsInitialized() const122 	sal_Bool IsInitialized() const {return bIsInitialized;}
IsServiceAvailable() const123 	sal_Bool IsServiceAvailable() const {return bServiceAvailable;}
124 
125 	void CreatePopup(const Point& rPt);
126 
127 	static void		CreateErrorMessage(Window* pParent);
128 };
129 
130 #endif
131 
132