bump product version to 4.1.6.2
[LibreOffice.git] / sw / source / ui / inc / unotools.hxx
blob33a8cbab8a1f56dd02d9f65e5068703d60d6a37d
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef _UNOTOOLS_HXX
20 #define _UNOTOOLS_HXX
23 #include <vcl/button.hxx>
24 #include <vcl/edit.hxx>
25 #include <vcl/dialog.hxx>
26 #include <vcl/fixed.hxx>
27 #include <vcl/layout.hxx>
28 #include <actctrl.hxx>
29 #include <com/sun/star/frame/XController.hpp>
30 #include <com/sun/star/text/XTextCursor.hpp>
31 #include <com/sun/star/container/XNameAccess.hpp>
32 #include <com/sun/star/awt/XControl.hpp>
33 #include <com/sun/star/container/XNamed.hpp>
34 #include <tools/resary.hxx>
35 #include "swdllapi.h"
37 class SwOneExampleFrame;
39 class SwFrmCtrlWindow : public VclEventBox
41 SwOneExampleFrame* pExampleFrame;
42 public:
43 SwFrmCtrlWindow(Window* pParent, SwOneExampleFrame* pFrame);
45 virtual void Command( const CommandEvent& rCEvt );
46 virtual Size GetOptimalSize() const;
47 virtual void Resize();
50 class MenuResource : public Resource
52 ResStringArray aMenuArray;
54 public:
55 MenuResource(const ResId& rResId);
57 ResStringArray& GetMenuArray() {return aMenuArray;}
60 #define EX_SHOW_ONLINE_LAYOUT 0x001
62 // hard zoom value
63 #define EX_SHOW_BUSINESS_CARDS 0x02
64 //don't modify page size
65 #define EX_SHOW_DEFAULT_PAGE 0x04
67 class SwView;
69 class SW_DLLPUBLIC SwOneExampleFrame
71 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > _xControl;
72 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > _xModel;
73 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > _xController;
74 ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > _xCursor;
76 SwFrmCtrlWindow aTopWindow;
77 Timer aLoadedTimer;
78 Link aInitializedLink;
80 MenuResource aMenuRes;
81 String sArgumentURL;
83 SwView* pModuleView;
85 sal_uInt32 nStyleFlags;
87 sal_Bool bIsInitialized;
88 sal_Bool bServiceAvailable;
90 static bool bShowServiceNotAvailableMessage;
92 SW_DLLPRIVATE DECL_LINK( TimeoutHdl, Timer* );
93 SW_DLLPRIVATE DECL_LINK( PopupHdl, Menu* );
95 SW_DLLPRIVATE void CreateControl();
96 SW_DLLPRIVATE void DisposeControl();
98 public:
99 SwOneExampleFrame(Window& rWin,
100 sal_uInt32 nStyleFlags = EX_SHOW_ONLINE_LAYOUT,
101 const Link* pInitalizedLink = 0,
102 String* pURL = 0);
103 ~SwOneExampleFrame();
105 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > & GetControl() {return _xControl; }
106 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & GetModel() {return _xModel;}
107 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController > & GetController() {return _xController;}
108 ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > & GetTextCursor() {return _xCursor;}
110 void ClearDocument( sal_Bool bStartTimer = sal_False );
112 sal_Bool IsInitialized() const {return bIsInitialized;}
113 sal_Bool IsServiceAvailable() const {return bServiceAvailable;}
115 void CreatePopup(const Point& rPt);
117 static void CreateErrorMessage(Window* pParent);
120 #endif
122 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */