LibreOffice Module shell (master) 1
propertyhdl.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 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19
20#ifndef INCLUDED_SHELL_INC_INTERNAL_PROPERTYHDL_HXX
21#define INCLUDED_SHELL_INC_INTERNAL_PROPERTYHDL_HXX
22
23#include <shlobj.h>
24
25// {AE424E85-F6DF-4910-A6A9-438797986431}
27{ 0xae424e85, 0xf6df, 0x4910, { 0xa6, 0xa9, 0x43, 0x87, 0x97, 0x98, 0x64, 0x31 } };
28
29class CMetaInfoReader;
30
31class CPropertyHdl : public IPropertyStore,
32 public IPropertyStoreCapabilities,
33 public IInitializeWithStream
34{
35public:
36 CPropertyHdl(LONG RefCnt = 1);
37 virtual ~CPropertyHdl();
38
39
40 // IUnknown methods
41
42 virtual HRESULT STDMETHODCALLTYPE QueryInterface(
43 REFIID riid,
44 void __RPC_FAR *__RPC_FAR *ppvObject ) override;
45 virtual ULONG STDMETHODCALLTYPE AddRef() override;
46 virtual ULONG STDMETHODCALLTYPE Release() override;
47
48
49 // IPropertyStore
50
51 virtual HRESULT STDMETHODCALLTYPE GetCount( DWORD *pcProps ) override;
52 virtual HRESULT STDMETHODCALLTYPE GetAt( DWORD iProp, PROPERTYKEY *pkey ) override;
53 virtual HRESULT STDMETHODCALLTYPE GetValue( REFPROPERTYKEY key, PROPVARIANT *pPropVar ) override;
54 virtual HRESULT STDMETHODCALLTYPE SetValue( REFPROPERTYKEY key, REFPROPVARIANT propVar ) override;
55 virtual HRESULT STDMETHODCALLTYPE Commit() override;
56
57
58 // IPropertyStoreCapabilities
59
60 virtual HRESULT STDMETHODCALLTYPE IsPropertyWritable( REFPROPERTYKEY key ) override;
61
62
63 // IInitializeWithStream
64
65 virtual HRESULT STDMETHODCALLTYPE Initialize(IStream *pStream, DWORD grfMode) override;
66
67private:
68 void LoadProperties( CMetaInfoReader *pMetaInfoReader );
69
70private:
72 IPropertyStoreCache* m_pCache;
73};
74
75class CClassFactory : public IClassFactory
76{
77public:
78 CClassFactory( const CLSID& clsid );
79 virtual ~CClassFactory();
80
81
82 // IUnknown methods
83
84 virtual HRESULT STDMETHODCALLTYPE QueryInterface(
85 REFIID riid,
86 void __RPC_FAR *__RPC_FAR *ppvObject) override;
87 virtual ULONG STDMETHODCALLTYPE AddRef() override;
88 virtual ULONG STDMETHODCALLTYPE Release() override;
89
90
91 // IClassFactory methods
92
93 virtual HRESULT STDMETHODCALLTYPE CreateInstance(
94 IUnknown __RPC_FAR *pUnkOuter,
95 REFIID riid,
96 void __RPC_FAR *__RPC_FAR *ppvObject) override;
97
98 virtual HRESULT STDMETHODCALLTYPE LockServer( BOOL fLock ) override;
99 static bool IsLocked();
100
101private:
103 CLSID m_Clsid;
104 static LONG s_ServerLocks;
105};
106
107#endif
108
109/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject) override
static bool IsLocked()
virtual ~CClassFactory()
virtual HRESULT STDMETHODCALLTYPE LockServer(BOOL fLock) override
virtual ULONG STDMETHODCALLTYPE Release() override
CClassFactory(const CLSID &clsid)
virtual HRESULT STDMETHODCALLTYPE CreateInstance(IUnknown __RPC_FAR *pUnkOuter, REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject) override
virtual ULONG STDMETHODCALLTYPE AddRef() override
static LONG s_ServerLocks
virtual HRESULT STDMETHODCALLTYPE SetValue(REFPROPERTYKEY key, REFPROPVARIANT propVar) override
virtual HRESULT STDMETHODCALLTYPE GetCount(DWORD *pcProps) override
void LoadProperties(CMetaInfoReader *pMetaInfoReader)
virtual HRESULT STDMETHODCALLTYPE GetValue(REFPROPERTYKEY key, PROPVARIANT *pPropVar) override
virtual HRESULT STDMETHODCALLTYPE IsPropertyWritable(REFPROPERTYKEY key) override
virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void __RPC_FAR *__RPC_FAR *ppvObject) override
Definition: propertyhdl.cxx:76
virtual HRESULT STDMETHODCALLTYPE Commit() override
CPropertyHdl(LONG RefCnt=1)
Definition: propertyhdl.cxx:54
virtual ~CPropertyHdl()
Definition: propertyhdl.cxx:63
virtual ULONG STDMETHODCALLTYPE AddRef() override
virtual HRESULT STDMETHODCALLTYPE GetAt(DWORD iProp, PROPERTYKEY *pkey) override
IPropertyStoreCache * m_pCache
Definition: propertyhdl.hxx:72
virtual ULONG STDMETHODCALLTYPE Release() override
virtual HRESULT STDMETHODCALLTYPE Initialize(IStream *pStream, DWORD grfMode) override
const CLSID CLSID_PROPERTY_HANDLER
Definition: propertyhdl.hxx:26
const wchar_t *typedef BOOL
LONG