1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 //+-------------------------------------------------------------------------
25 // Contents: C++ wrapper(s) for FULLPROPSPEC
28 #pragma warning(push, 1)
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.
51 CFullPropSpec( GUID
const & guidPropSet
, PROPID pidProperty
);
52 CFullPropSpec( GUID
const & guidPropSet
, WCHAR
const * wcsProperty
);
54 inline BOOL
IsValid() const;
56 // Copy constructors/assignment/clone
57 CFullPropSpec( CFullPropSpec
const & Property
);
58 CFullPropSpec
& operator=( CFullPropSpec
const & Property
);
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;
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;
84 // Inline methods for CFullPropSpec
85 inline void * CFullPropSpec::operator new( size_t size
)
87 void * p
= CoTaskMemAlloc( size
);
90 inline void * CFullPropSpec::operator new( size_t /*size*/, void * p
)
94 inline void CFullPropSpec::operator delete( void * 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
112 inline PROPSPEC
CFullPropSpec::GetPropSpec() const
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: */