Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / winaccessibility / source / UAccCOM / EnumVariant.h
blobdc560a5478a1840694a5c0093b1a1f7399781f22
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 INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ENUMVARIANT_H
21 #define INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ENUMVARIANT_H
23 #include "resource.h" // main symbols
24 #include <com/sun/star/accessibility/XAccessible.hpp>
25 #include <com/sun/star/accessibility/XAccessibleSelection.hpp>
26 #include <AccObjectManagerAgent.hxx>
28 #if defined __clang__
29 #pragma clang diagnostic push
30 #pragma clang diagnostic ignored "-Wnon-virtual-dtor"
31 #endif
32 #include "UAccCOM.h"
33 #if defined __clang__
34 #pragma clang diagnostic pop
35 #endif
37 /**
38 * CEnumVariant implements IEnumVARIANT interface.
40 class ATL_NO_VTABLE CEnumVariant :
41 public CComObjectRootEx<CComMultiThreadModel>,
42 public CComCoClass<CEnumVariant, &CLSID_EnumVariant>,
43 public IDispatchImpl<IEnumVariant, &IID_IEnumVariant, &LIBID_UACCCOMLib>
45 public:
46 CEnumVariant()
47 :m_lLBound(0),
48 pUNOInterface(NULL),
49 m_pXAccessibleSelection(NULL)
51 m_lCurrent = m_lLBound;
54 virtual ~CEnumVariant() {};
56 DECLARE_NO_REGISTRY()
58 DECLARE_PROTECT_FINAL_CONSTRUCT()
60 BEGIN_COM_MAP(CEnumVariant)
61 COM_INTERFACE_ENTRY(IEnumVariant)
62 COM_INTERFACE_ENTRY(IEnumVARIANT)
63 END_COM_MAP()
65 // IEnumVariant
66 public:
68 STDMETHOD(ClearEnumeration)();
70 // IEnumVARIANT
73 HRESULT STDMETHODCALLTYPE Next(ULONG cElements,VARIANT __RPC_FAR *pvar,ULONG __RPC_FAR *pcElementFetched);
76 HRESULT STDMETHODCALLTYPE Skip(ULONG cElements);
79 HRESULT STDMETHODCALLTYPE Reset( void);
82 HRESULT STDMETHODCALLTYPE Clone(IEnumVARIANT __RPC_FAR *__RPC_FAR *ppenum);
84 // IEnumVariant
87 HRESULT STDMETHODCALLTYPE PutSelection(hyper pXSelection);
90 static HRESULT STDMETHODCALLTYPE Create(CEnumVariant __RPC_FAR *__RPC_FAR *ppenum);
93 long GetCountOfElements();
95 private:
97 long m_lCurrent;
98 long m_lLBound;
99 css::accessibility::XAccessible* pUNOInterface;
100 css::uno::Reference<css::accessibility::XAccessibleSelection>
101 m_pXAccessibleSelection;
104 #endif // INCLUDED_WINACCESSIBILITY_SOURCE_UACCCOM_ENUMVARIANT_H
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */