1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 #ifndef _STORE_STORLCKB_HXX_
30 #define _STORE_STORLCKB_HXX_
32 #include "sal/types.h"
34 #include "rtl/ustring.h"
35 #include "rtl/ref.hxx"
38 #include "storbase.hxx"
39 #include "storpage.hxx"
44 struct OStoreDataPageData
;
45 struct OStoreDirectoryPageData
;
47 /*========================================================================
49 * OStoreLockBytes interface.
51 *======================================================================*/
52 class OStoreLockBytes
: public store::OStoreObject
57 OStoreLockBytes (void);
59 /** create (two-phase construction).
60 * @param pManager [in]
64 * @return store_E_None upon success
67 OStorePageManager
*pManager
,
70 storeAccessMode eAccessMode
);
72 /** Read at Offset into Buffer.
74 * @param pBuffer [out]
77 * @return store_E_None upon success
85 /** Write at Offset from Buffer.
90 * @return store_E_None upon success
99 * @return store_E_None upon success
101 storeError
flush (void);
105 * @return store_E_None upon success
107 storeError
setSize (sal_uInt32 nSize
);
110 * @paran rnSize [out]
111 * @return store_E_None upon success
113 storeError
stat (sal_uInt32
&rnSize
);
117 virtual sal_Bool SAL_CALL
isKindOf (sal_uInt32 nMagic
);
120 /** Destruction (OReference).
122 virtual ~OStoreLockBytes (void);
125 /** IStoreHandle TypeId.
127 static const sal_uInt32 m_nTypeId
;
129 /** IStoreHandle query() template specialization.
131 friend OStoreLockBytes
*
132 SAL_CALL query
<> (IStoreHandle
*pHandle
, OStoreLockBytes
*);
136 rtl::Reference
<OStorePageManager
> m_xManager
;
138 typedef OStoreDataPageData data
;
139 typedef OStoreDirectoryPageData inode
;
141 typedef PageHolderObject
< inode
> inode_holder_type
;
142 inode_holder_type m_xNode
;
148 OStoreLockBytes (const OStoreLockBytes
&);
149 OStoreLockBytes
& operator= (const OStoreLockBytes
&);
152 template<> inline OStoreLockBytes
*
153 SAL_CALL
query (IStoreHandle
*pHandle
, SAL_UNUSED_PARAMETER OStoreLockBytes
*)
155 if (pHandle
&& pHandle
->isKindOf (OStoreLockBytes::m_nTypeId
))
157 // Handle is kind of OStoreLockBytes.
158 return static_cast<OStoreLockBytes
*>(pHandle
);
163 /*========================================================================
167 *======================================================================*/
171 #endif /* !_STORE_STORLCKB_HXX_ */
173 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */