First public contribution.
1 // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
16 #ifndef SQLCOMPACTCONN_H
17 #define SQLCOMPACTCONN_H
19 #include "SqlCompact.h"
21 //Forward declarations
23 struct TSqlFreePageCallback;
26 #define SQLCOMPACTCONN_INVARIANT() Invariant()
28 #define SQLCOMPACTCONN_INVARIANT() void(0)
32 An implementation class for the MSqlCompactConn interface.
33 Establishes a connection with the database.
34 The established connection can be used for compacting the database.
40 NONSHARABLE_CLASS(CSqlCompactConn) : public CBase, public MSqlCompactConn
42 friend class CSqlCompactTestActive;
45 static CSqlCompactConn* NewL(const TDesC& aFullName, TSqlFreePageCallback& aFreePageCallback);
46 virtual ~CSqlCompactConn();
47 virtual void Release();
48 virtual TInt Compact(TInt aPageCount, TInt& aProcessedPageCount, TInt aLength);
49 void Invariant() const;
52 void ConstructL(const TDesC& aFullName, TSqlFreePageCallback& aFreePageCallback);
53 TInt FreePageCountL();
62 A factory function for the MSqlCompactConn interface.
68 MSqlCompactConn* SqlCreateCompactConnL(const TDesC& aFullName, TSqlFreePageCallback& aFreePageCallback);
70 #endif//SQLCOMPACTCONN_H