fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / basctl / source / inc / dlgedobj.hxx
blobe7817e4cc2a9146b5fa9521e46b2ba24a68c01f1
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 .
20 #ifndef BASCTL_DLGEDOBJ_HXX
21 #define BASCTL_DLGEDOBJ_HXX
23 #include <com/sun/star/frame/XModel.hpp>
24 #include <com/sun/star/beans/XPropertyChangeListener.hpp>
25 #include <com/sun/star/container/XContainerListener.hpp>
26 #include <comphelper/processfactory.hxx>
27 #include <svx/svdouno.hxx>
29 #include <boost/optional.hpp>
31 namespace basctl
34 typedef ::std::multimap< sal_Int16, OUString, ::std::less< sal_Int16 > > IndexToNameMap;
37 class DlgEdForm;
38 class DlgEditor;
40 //============================================================================
41 // DlgEdObj
42 //============================================================================
44 class DlgEdObj: public SdrUnoObj
46 friend class DlgEditor;
47 friend class DlgEdFactory;
48 friend class DlgEdPropListenerImpl;
49 friend class DlgEdForm;
51 private:
52 bool bIsListening;
53 DlgEdForm* pDlgEdForm;
54 ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener> m_xPropertyChangeListener;
55 ::com::sun::star::uno::Reference< ::com::sun::star::container::XContainerListener> m_xContainerListener;
57 private:
58 DlgEditor& GetDialogEditor ();
60 protected:
61 DlgEdObj();
62 DlgEdObj(const OUString& rModelName,
63 const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rxSFac);
65 virtual void NbcMove( const Size& rSize );
66 virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
67 virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
69 using SfxListener::StartListening;
70 void StartListening();
71 using SfxListener::EndListening;
72 void EndListening(bool bRemoveListener = true);
73 bool isListening() const { return bIsListening; }
75 virtual bool TransformSdrToControlCoordinates(
76 sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn,
77 sal_Int32& nXOut, sal_Int32& nYOut, sal_Int32& nWidthOut, sal_Int32& nHeightOut );
78 virtual bool TransformSdrToFormCoordinates(
79 sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn,
80 sal_Int32& nXOut, sal_Int32& nYOut, sal_Int32& nWidthOut, sal_Int32& nHeightOut );
81 virtual bool TransformControlToSdrCoordinates(
82 sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn,
83 sal_Int32& nXOut, sal_Int32& nYOut, sal_Int32& nWidthOut, sal_Int32& nHeightOut );
84 virtual bool TransformFormToSdrCoordinates(
85 sal_Int32 nXIn, sal_Int32 nYIn, sal_Int32 nWidthIn, sal_Int32 nHeightIn,
86 sal_Int32& nXOut, sal_Int32& nYOut, sal_Int32& nWidthOut, sal_Int32& nHeightOut );
88 public:
89 TYPEINFO();
91 virtual ~DlgEdObj();
92 virtual void SetPage(SdrPage* pNewPage);
94 virtual void SetDlgEdForm( DlgEdForm* pForm ) { pDlgEdForm = pForm; }
95 virtual DlgEdForm* GetDlgEdForm() const { return pDlgEdForm; }
97 virtual sal_uInt32 GetObjInventor() const;
98 virtual sal_uInt16 GetObjIdentifier() const;
100 virtual DlgEdObj* Clone() const; // not working yet
101 virtual void clonedFrom(const DlgEdObj* _pSource); // not working yet
103 // FullDrag support
104 virtual SdrObject* getFullDragClone() const;
106 virtual sal_Bool supportsService( const sal_Char* _pServiceName ) const;
107 virtual OUString GetDefaultName() const;
108 virtual OUString GetUniqueName() const;
110 virtual sal_Int32 GetStep() const;
111 virtual void UpdateStep();
113 virtual void SetDefaults();
114 virtual void SetRectFromProps();
115 virtual void SetPropsFromRect();
117 ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControl > GetControl() const;
119 virtual void PositionAndSizeChange( const ::com::sun::star::beans::PropertyChangeEvent& evt );
120 virtual void SAL_CALL NameChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw( ::com::sun::star::uno::RuntimeException);
121 virtual void SAL_CALL TabIndexChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw( ::com::sun::star::uno::RuntimeException);
123 // PropertyChangeListener
124 virtual void SAL_CALL _propertyChange( const ::com::sun::star::beans::PropertyChangeEvent& evt ) throw(::com::sun::star::uno::RuntimeException);
126 // ContainerListener
127 virtual void SAL_CALL _elementInserted( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
128 virtual void SAL_CALL _elementReplaced( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
129 virtual void SAL_CALL _elementRemoved( const ::com::sun::star::container::ContainerEvent& Event ) throw(::com::sun::star::uno::RuntimeException);
131 virtual void SetLayer(SdrLayerID nLayer);
132 bool MakeDataAware( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xModel );
136 //============================================================================
137 // DlgEdForm
138 //============================================================================
140 class DlgEdForm: public DlgEdObj
142 friend class DlgEditor;
143 friend class DlgEdFactory;
145 private:
146 DlgEditor& rDlgEditor;
147 ::std::vector<DlgEdObj*> pChildren;
149 mutable ::boost::optional< ::com::sun::star::awt::DeviceInfo > mpDeviceInfo;
151 private:
152 explicit DlgEdForm (DlgEditor&);
154 protected:
155 virtual void NbcMove( const Size& rSize );
156 virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact);
157 virtual bool EndCreate(SdrDragStat& rStat, SdrCreateCmd eCmd);
159 public:
160 TYPEINFO();
162 virtual ~DlgEdForm();
164 virtual DlgEditor& GetDlgEditor () const { return rDlgEditor; }
166 virtual void AddChild( DlgEdObj* pDlgEdObj );
167 virtual void RemoveChild( DlgEdObj* pDlgEdObj );
168 virtual std::vector<DlgEdObj*> const& GetChildren() const { return pChildren; }
170 virtual void UpdateStep();
172 virtual void SetRectFromProps();
173 virtual void SetPropsFromRect();
175 virtual void PositionAndSizeChange( const ::com::sun::star::beans::PropertyChangeEvent& evt );
177 virtual void UpdateTabIndices();
178 virtual void UpdateTabOrder();
179 virtual void UpdateGroups();
180 virtual void UpdateTabOrderAndGroups();
182 ::com::sun::star::awt::DeviceInfo getDeviceInfo() const;
184 private:
185 void ImplInvalidateDeviceInfo();
188 } // namespace basctl
190 #endif // BASCTL_DLGEDOBJ_HXX
192 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */