Bump version to 5.0-14
[LibreOffice.git] / shell / source / win32 / shlxthandler / ooofilt / propspec.hxx
blob682d7df4b6658bb14bfbee56f14fe2270a28abc3
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_SHELL_SOURCE_WIN32_SHLXTHANDLER_OOOFILT_PROPSPEC_HXX
21 #define INCLUDED_SHELL_SOURCE_WIN32_SHLXTHANDLER_OOOFILT_PROPSPEC_HXX
23 //+-------------------------------------------------------------------------
24 // File: propspec.hxx
25 // Contents: C++ wrapper(s) for FULLPROPSPEC
27 #if defined _MSC_VER
28 #pragma warning(push, 1)
29 #endif
30 #include <windows.h>
31 #include <ole2.h>
32 #include <ntquery.h>
33 #if defined _MSC_VER
34 #pragma warning(pop)
35 #endif
36 //+-------------------------------------------------------------------------
37 // Declare: CLSID_SummaryInforation, GUID
38 // CLSID_Storage, GUID
39 // Contents: Definitions of OpenOffice.org Document properties
42 //+-------------------------------------------------------------------------
43 // Class: CFullPropertySpec
44 // Purpose: Describes full (PropertySet\Property) name of a property.
47 class CFullPropSpec
49 public:
50 CFullPropSpec();
51 CFullPropSpec( GUID const & guidPropSet, PROPID pidProperty );
52 CFullPropSpec( GUID const & guidPropSet, WCHAR const * wcsProperty );
53 // Validity check
54 inline BOOL IsValid() const;
56 // Copy constructors/assignment/clone
57 CFullPropSpec( CFullPropSpec const & Property );
58 CFullPropSpec & operator=( CFullPropSpec const & Property );
59 ~CFullPropSpec();
60 // Memory allocation
61 void * operator new( size_t size );
62 inline void * operator new( size_t size, void * p );
63 void operator delete( void * p );
64 inline FULLPROPSPEC * CastToStruct();
65 inline FULLPROPSPEC const * CastToStruct() const;
66 // Comparators
67 int operator==( CFullPropSpec const & prop ) const;
68 int operator!=( CFullPropSpec const & prop ) const;
69 // Member variable access
70 inline void SetPropSet( GUID const & guidPropSet );
71 inline GUID const & GetPropSet() const;
73 void SetProperty( PROPID pidProperty );
74 BOOL SetProperty( WCHAR const * wcsProperty );
75 inline WCHAR const * GetPropertyName() const;
76 inline PROPID GetPropertyPropid() const;
77 inline PROPSPEC GetPropSpec() const;
78 inline BOOL IsPropertyName() const;
79 inline BOOL IsPropertyPropid() const;
80 private:
81 GUID _guidPropSet;
82 PROPSPEC _psProperty;
84 // Inline methods for CFullPropSpec
85 inline void * CFullPropSpec::operator new( size_t size )
87 void * p = CoTaskMemAlloc( size );
88 return p;
90 inline void * CFullPropSpec::operator new( size_t /*size*/, void * p )
92 return p;
94 inline void CFullPropSpec::operator delete( void * p )
96 if ( p )
97 CoTaskMemFree( p );
99 inline BOOL CFullPropSpec::IsValid() const
101 return ( _psProperty.ulKind == PRSPEC_PROPID ||
102 0 != _psProperty.lpwstr );
104 inline void CFullPropSpec::SetPropSet( GUID const & guidPropSet )
106 _guidPropSet = guidPropSet;
108 inline GUID const & CFullPropSpec::GetPropSet() const
110 return _guidPropSet;
112 inline PROPSPEC CFullPropSpec::GetPropSpec() const
114 return _psProperty;
116 inline WCHAR const * CFullPropSpec::GetPropertyName() const
118 return _psProperty.lpwstr;
120 inline PROPID CFullPropSpec::GetPropertyPropid() const
122 return _psProperty.propid;
124 inline BOOL CFullPropSpec::IsPropertyName() const
126 return _psProperty.ulKind == PRSPEC_LPWSTR;
128 inline BOOL CFullPropSpec::IsPropertyPropid() const
130 return _psProperty.ulKind == PRSPEC_PROPID;
133 #endif // INCLUDED_SHELL_SOURCE_WIN32_SHLXTHANDLER_OOOFILT_PROPSPEC_HXX
135 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */