1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: storlckb.hxx,v $
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 ************************************************************************/
31 #ifndef _STORE_STORLCKB_HXX_
32 #define _STORE_STORLCKB_HXX_ "$Revision: 1.6.8.1 $"
34 #include "sal/types.h"
36 #include "rtl/ustring.h"
37 #include "rtl/ref.hxx"
40 #include "storbase.hxx"
41 #include "storpage.hxx"
46 struct OStoreDataPageData
;
47 struct OStoreDirectoryPageData
;
49 /*========================================================================
51 * OStoreLockBytes interface.
53 *======================================================================*/
54 class OStoreLockBytes
: public store::OStoreObject
59 OStoreLockBytes (void);
61 /** create (two-phase construction).
62 * @param pManager [in]
66 * @return store_E_None upon success
69 OStorePageManager
*pManager
,
72 storeAccessMode eAccessMode
);
74 /** Read at Offset into Buffer.
76 * @param pBuffer [out]
79 * @return store_E_None upon success
87 /** Write at Offset from Buffer.
92 * @return store_E_None upon success
101 * @return store_E_None upon success
103 storeError
flush (void);
107 * @return store_E_None upon success
109 storeError
setSize (sal_uInt32 nSize
);
112 * @paran rnSize [out]
113 * @return store_E_None upon success
115 storeError
stat (sal_uInt32
&rnSize
);
119 virtual sal_Bool SAL_CALL
isKindOf (sal_uInt32 nMagic
);
122 /** Destruction (OReference).
124 virtual ~OStoreLockBytes (void);
127 /** IStoreHandle TypeId.
129 static const sal_uInt32 m_nTypeId
;
131 /** IStoreHandle query() template specialization.
133 friend OStoreLockBytes
*
134 SAL_CALL query
<> (IStoreHandle
*pHandle
, OStoreLockBytes
*);
138 rtl::Reference
<OStorePageManager
> m_xManager
;
140 typedef OStoreDataPageData data
;
141 typedef OStoreDirectoryPageData inode
;
143 typedef PageHolderObject
< inode
> inode_holder_type
;
144 inode_holder_type m_xNode
;
150 OStoreLockBytes (const OStoreLockBytes
&);
151 OStoreLockBytes
& operator= (const OStoreLockBytes
&);
154 template<> inline OStoreLockBytes
*
155 SAL_CALL
query (IStoreHandle
*pHandle
, OStoreLockBytes
*)
157 if (pHandle
&& pHandle
->isKindOf (OStoreLockBytes::m_nTypeId
))
159 // Handle is kind of OStoreLockBytes.
160 return static_cast<OStoreLockBytes
*>(pHandle
);
165 /*========================================================================
169 *======================================================================*/
173 #endif /* !_STORE_STORLCKB_HXX_ */