transport: pass correct channel
[abstract.git] / storage / base / aaSaveEvent.h
blobc6c124ab1c54ec87a71d0b5082c1ea5683d6ee9a
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim:set ts=2 sw=2 sts=2 et cindent tw=79 ft=cpp: */
3 /*
4 * Copyright (C) 2007,2008 Sergey Yanovich <ynvich@gmail.com>
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public
17 * License along with this program; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
22 #ifndef AASAVEEVENT_H
23 #define AASAVEEVENT_H 1
25 #define AA_SAVEEVENT_CID \
26 {0xc1b3d0a4, 0x9286, 0x42aa, {0xa1, 0x0f, 0x5c, 0x72, 0xa9, 0x7a, 0x04, 0x90}}
28 #include "aaISqlTransaction.h"
29 #include "aaIStorager.h"
31 class aaIEvent;
32 class aaISqlRequest;
33 #ifdef DEBUG
34 #include "aaIEvent.h"
35 #include "aaISqlRequest.h"
36 #include "mozIStorageConnection.h"
37 #endif
39 class aaSaveEvent : public aaISqlTransaction,
40 public aaIStorager
42 public:
43 aaSaveEvent();
44 NS_DECL_ISUPPORTS
45 NS_DECL_AAISQLTRANSACTION
46 NS_DECL_AAISTORAGER
48 private:
49 ~aaSaveEvent() {}
50 friend class aaStorageTest;
52 nsCOMPtr<aaIEvent> mEvent;
53 nsCOMPtr<aaISqlRequest> mEventInserter;
54 nsCOMPtr<aaISqlRequest> mEventIdLoader;
55 nsCOMPtr<aaISqlRequest> mStateLoader;
56 nsCOMPtr<aaISqlRequest> mTransferInserter;
57 nsCOMPtr<aaISqlRequest> mTransferIdLoader;
58 nsCOMPtr<aaISqlRequest> mSideInserter;
59 nsCOMPtr<aaISqlTransaction> mStateInserter;
60 nsCOMPtr<aaISqlRequest> mFactLoader;
61 nsCOMPtr<aaISqlTransaction> mRuleLoader;
62 nsCOMPtr<aaISqlRequest> mEventDeleter;
63 nsCOMPtr<aaISqlRequest> mTransferDeleter;
64 nsCOMPtr<aaISqlRequest> mSideDeleter;
66 nsresult insertEvent(aaISqliteChannel *aChannel);
67 nsresult processFact(aaISqliteChannel *aChannel, PRUint32 aIndex);
68 nsresult loadFlowState(aaISqliteChannel *aChannel, aaIFlow *aFlow,
69 aaIState * * aState);
70 nsresult insertTransfer(aaISqliteChannel *aChannel, aaIFact *aFact);
71 nsresult loadRules(aaISqliteChannel *aChannel, aaIFact *aFact);
72 nsresult insertSide(aaISqliteChannel *aChannel, aaIState *aState);
73 nsresult insertState(aaISqliteChannel *aChannel, aaIState *aState);
74 nsresult setStates(aaISqliteChannel *aChannel, aaIFact *aFact, PRBool insert);
76 nsresult cleanEvent(aaISqliteChannel *aChannel);
77 nsresult deleteSide(aaISqliteChannel *aChannel);
78 nsresult deleteTransfer(aaISqliteChannel *aChannel);
79 nsresult deleteEvent(aaISqliteChannel *aChannel);
82 #endif /* AASAVEEVENT_H */