update dev300-m58
[ooovba.git] / shell / source / win32 / shlxthandler / ooofilt / propspec.hxx
blob8c587ed0e3483ef50bbab09e15c5882bb1a01577
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: propspec.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 //+-------------------------------------------------------------------------
32 // File: propspec.hxx
34 // Contents: C++ wrapper(s) for FULLPROPSPEC
36 //-------------------------------------------------------------------------
37 #pragma once
38 #if defined _MSC_VER
39 #pragma warning(push, 1)
40 #endif
41 #include <windows.h>
42 #include <ole2.h>
43 #include <ntquery.h>
44 #if defined _MSC_VER
45 #pragma warning(pop)
46 #endif
47 //+-------------------------------------------------------------------------
49 // Declare: CLSID_SummaryInforation, GUID
50 // CLSID_Storage, GUID
52 // Contents: Definitions of OpenOffice.org Document properties
54 //--------------------------------------------------------------------------
56 //extern GUID CLSID_Storage;
58 //extern GUID CLSID_SummaryInformation;
59 //const PID_TITLE = PIDSI_TITLE; // 2;
60 //const PID_SUBJECT = PIDSI_SUBJECT; // 3;
61 //const PID_AUTHOR = PIDSI_AUTHOR; // 4;
62 //const PID_KEYWORDS = PIDSI_KEYWORDS; // 5;
63 //const PID_COMMENTS = PIDSI_COMMENTS; //6;
64 //const PID_REVNUMBER = PIDSI_REVNUMBER; //9;
65 //const PID_WORDCOUNT = PIDSI_WORDCOUNT; //f;
66 //+-------------------------------------------------------------------------
68 // Class: CFullPropertySpec
70 // Purpose: Describes full (PropertySet\Property) name of a property.
72 //--------------------------------------------------------------------------
74 class CFullPropSpec
76 public:
77 CFullPropSpec();
78 CFullPropSpec( GUID const & guidPropSet, PROPID pidProperty );
79 CFullPropSpec( GUID const & guidPropSet, WCHAR const * wcsProperty );
80 // Validity check
81 inline BOOL IsValid() const;
83 // Copy constructors/assignment/clone
84 CFullPropSpec( CFullPropSpec const & Property );
85 CFullPropSpec & operator=( CFullPropSpec const & Property );
86 ~CFullPropSpec();
87 // Memory allocation
88 void * operator new( size_t size );
89 inline void * operator new( size_t size, void * p );
90 void operator delete( void * p );
91 inline FULLPROPSPEC * CastToStruct();
92 inline FULLPROPSPEC const * CastToStruct() const;
93 // Comparators
94 int operator==( CFullPropSpec const & prop ) const;
95 int operator!=( CFullPropSpec const & prop ) const;
96 // Member variable access
97 inline void SetPropSet( GUID const & guidPropSet );
98 inline GUID const & GetPropSet() const;
100 void SetProperty( PROPID pidProperty );
101 BOOL SetProperty( WCHAR const * wcsProperty );
102 inline WCHAR const * GetPropertyName() const;
103 inline PROPID GetPropertyPropid() const;
104 inline PROPSPEC GetPropSpec() const;
105 inline BOOL IsPropertyName() const;
106 inline BOOL IsPropertyPropid() const;
107 private:
108 GUID _guidPropSet;
109 PROPSPEC _psProperty;
111 // Inline methods for CFullPropSpec
112 inline void * CFullPropSpec::operator new( size_t size )
114 void * p = CoTaskMemAlloc( size );
115 return( p );
117 inline void * CFullPropSpec::operator new( size_t /*size*/, void * p )
119 return( p );
121 inline void CFullPropSpec::operator delete( void * p )
123 if ( p )
124 CoTaskMemFree( p );
126 inline BOOL CFullPropSpec::IsValid() const
128 return ( _psProperty.ulKind == PRSPEC_PROPID ||
129 0 != _psProperty.lpwstr );
131 inline void CFullPropSpec::SetPropSet( GUID const & guidPropSet )
133 _guidPropSet = guidPropSet;
135 inline GUID const & CFullPropSpec::GetPropSet() const
137 return( _guidPropSet );
139 inline PROPSPEC CFullPropSpec::GetPropSpec() const
141 return( _psProperty );
143 inline WCHAR const * CFullPropSpec::GetPropertyName() const
145 return( _psProperty.lpwstr );
147 inline PROPID CFullPropSpec::GetPropertyPropid() const
149 return( _psProperty.propid );
151 inline BOOL CFullPropSpec::IsPropertyName() const
153 return( _psProperty.ulKind == PRSPEC_LPWSTR );
155 inline BOOL CFullPropSpec::IsPropertyPropid() const
157 return( _psProperty.ulKind == PRSPEC_PROPID );