bump product version to 4.1.6.2
[LibreOffice.git] / include / sfx2 / event.hxx
blobbcdc88ec2edb8b8eed6e50af646034bd28ed3a6b
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 _SFXEVENT_HXX
20 #define _SFXEVENT_HXX
22 #include "sal/config.h"
23 #include "sfx2/dllapi.h"
24 #include <tools/string.hxx>
25 #include <svl/hint.hxx>
26 #include <unotools/eventcfg.hxx>
27 #include <rtl/ustring.hxx>
29 #include <com/sun/star/uno/Sequence.hxx>
30 #include <com/sun/star/beans/PropertyValue.hpp>
31 #include <com/sun/star/frame/XController2.hpp>
33 class SfxObjectShell;
35 //-------------------------------------------------------------------
37 class SFX2_DLLPUBLIC SfxEventHint : public SfxHint
39 SfxObjectShell* pObjShell;
40 OUString aEventName;
41 sal_uInt16 nEventId;
43 public:
44 TYPEINFO();
45 SfxEventHint( sal_uInt16 nId, const OUString& aName, SfxObjectShell *pObj = 0 )
46 : pObjShell(pObj),
47 aEventName(aName),
48 nEventId(nId)
51 sal_uInt16 GetEventId() const
52 { return nEventId; }
54 OUString GetEventName() const
55 { return aEventName; }
57 SfxObjectShell* GetObjShell() const
58 { return pObjShell; }
61 //-------------------------------------------------------------------
63 class SFX2_DLLPUBLIC SfxViewEventHint : public SfxEventHint
65 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 > xViewController;
67 public:
68 TYPEINFO();
70 SfxViewEventHint( sal_uInt16 nId, const OUString& aName, SfxObjectShell *pObj, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController >& xController )
71 : SfxEventHint( nId, aName, pObj )
72 , xViewController( xController, ::com::sun::star::uno::UNO_QUERY )
75 SfxViewEventHint( sal_uInt16 nId, const OUString& aName, SfxObjectShell *pObj, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 >& xController )
76 : SfxEventHint( nId, aName, pObj )
77 , xViewController( xController )
80 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XController2 > GetController() const
81 { return xViewController; }
84 //-------------------------------------------------------------------
86 class SfxNamedHint : public SfxHint
88 String _aEventName;
89 SfxObjectShell* _pObjShell;
90 String _aArgs;
92 public:
93 TYPEINFO();
95 SfxNamedHint( const String& rName,
96 const String& rArgs,
97 SfxObjectShell *pObj = 0 )
98 : _aEventName( rName ),
99 _pObjShell( pObj),
100 _aArgs( rArgs )
103 SfxNamedHint( const String& rName,
104 SfxObjectShell *pObj = 0 )
105 : _aEventName( rName ),
106 _pObjShell( pObj )
109 const String& GetArgs() const { return _aArgs;}
110 const String& GetName() const { return _aEventName; }
111 SfxObjectShell* GetObjShell() const { return _pObjShell; }
114 class Printer;
115 class SfxPrintingHint : public SfxHint
117 sal_Int32 nWhich;
118 com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue > aOpts;
119 public:
120 TYPEINFO();
121 SfxPrintingHint( sal_Int32 nEvent, const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& rOpts )
122 : nWhich( nEvent )
123 , aOpts( rOpts )
126 SfxPrintingHint( sal_Int32 nEvent )
127 : nWhich( nEvent )
130 sal_Int32 GetWhich() const { return nWhich; }
131 const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& GetOptions() { return aOpts; }
134 #endif
136 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */