LibreOffice Module vcl (master)  1
uiobject_uno.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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/.
8  */
9 
10 #pragma once
11 
12 #include <cppuhelper/compbase.hxx>
13 #include <cppuhelper/basemutex.hxx>
14 #include <com/sun/star/lang/XServiceInfo.hpp>
15 #include <com/sun/star/ui/test/XUIObject.hpp>
16 
17 #include <memory>
18 #include <condition_variable>
19 #include <mutex>
20 
21 #include <tools/link.hxx>
22 #include <vcl/uitest/uiobject.hxx>
23 #include <vcl/window.hxx>
24 
25 class Timer;
26 
27 typedef ::cppu::WeakComponentImplHelper <
28  css::ui::test::XUIObject, css::lang::XServiceInfo
29  > UIObjectBase;
30 
32  public UIObjectBase
33 {
34 private:
35  std::unique_ptr<UIObject> mpObj;
36 
37 public:
38 
39  explicit UIObjectUnoObj(std::unique_ptr<UIObject> pObj);
40  virtual ~UIObjectUnoObj() override;
41 
42  css::uno::Reference<css::ui::test::XUIObject> SAL_CALL getChild(const OUString& rID) override;
43 
44  void SAL_CALL executeAction(const OUString& rAction, const css::uno::Sequence<css::beans::PropertyValue>& xPropValues) override;
45 
46  css::uno::Sequence<css::beans::PropertyValue> SAL_CALL getState() override;
47 
48  css::uno::Sequence<OUString> SAL_CALL getChildren() override;
49 
50  OUString SAL_CALL getType() override;
51 
52  OUString SAL_CALL getImplementationName() override;
53 
54  sal_Bool SAL_CALL supportsService(OUString const & ServiceName) override;
55 
56  css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
57 
58  OUString SAL_CALL getHierarchy() override;
59 
60 private:
61 
62  DECL_LINK( NotifyHdl, Timer*, void );
63 
64  std::condition_variable cv;
65  std::mutex mMutex;
66  bool mReady;
67 
68  OUString mAction;
69  css::uno::Sequence<css::beans::PropertyValue> mPropValues;
70 };
71 
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString SAL_CALL getHierarchy() override
css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
std::condition_variable cv
css::uno::Reference< css::ui::test::XUIObject > SAL_CALL getChild(const OUString &rID) override
sal_Bool SAL_CALL supportsService(OUString const &ServiceName) override
OUString mAction
std::mutex mMutex
unsigned char sal_Bool
css::uno::Sequence< css::beans::PropertyValue > mPropValues
UIObjectUnoObj(std::unique_ptr< UIObject > pObj)
OUString SAL_CALL getType() override
DECL_LINK(NotifyHdl, Timer *, void)
virtual ~UIObjectUnoObj() override
void SAL_CALL executeAction(const OUString &rAction, const css::uno::Sequence< css::beans::PropertyValue > &xPropValues) override
css::uno::Sequence< OUString > SAL_CALL getChildren() override
std::unique_ptr< UIObject > mpObj
css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getState() override
Definition: timer.hxx:26
OUString SAL_CALL getImplementationName() override
::cppu::WeakComponentImplHelper< css::ui::test::XUIObject, css::lang::XServiceInfo > UIObjectBase