Documents > BPS V2 C++ API
bpsrobot.h
Go to the documentation of this file.
00001 
00004 #ifndef BPSROBOT_H
00005 #define BPSROBOT_H
00006 
00007 #include "bpscore_global.h"
00008 #include <QObject>
00009 #include <QVariantList>
00010 
00011 class BpsDatastore;
00012 class BpsOrderUtils;
00013 
00017 class BPSCORE_EXPORT BpsRobot : public QObject
00018 {
00019     Q_OBJECT
00020     BPS_PRIVATE(BpsRobot)
00021 
00022 public:
00027     enum OrderSyncMode { 
00028         SyncAll     = 0,    
00029         SyncNew     = 1,    
00030         SyncUpdate  = 2     
00031     };
00032 
00036     enum OrderType { 
00037         Trips       = 0,    
00038         Rows        = 1,    
00039         Columns     = 2,    
00040         Items       = 3     
00041     };
00042 
00048     BpsRobot(BpsDatastore* aDatastore, const QVariant& aZone, QObject* aParent=0);
00049 
00053     virtual ~BpsRobot();
00054 
00058     BpsDatastore* datastore() const;
00059 
00063     BpsOrderUtils* utils() const;
00064 
00068     QVariant zone() const;
00069 
00073     QString zoneName() const;
00074 
00081     QVariantMap getOrdertripRobot(const QVariant& aOrdertrip) const;
00082 
00089     bool lockRobot(int aTimeout, volatile bool* aCancelFlag = 0);
00090 
00096     void unlockRobot();
00097 
00118     virtual void syncOrders(OrderType aOrderType, const QVariantList& aKeys, OrderSyncMode aSyncMode, volatile bool* aCancelFlag = 0) = 0;
00119 
00138     virtual void revokeOrders(OrderType aOrderType, const QVariantList& aKeys, volatile bool* aCancelFlag = 0) = 0;
00139 
00145     virtual void syncStock(volatile bool* aCancelFlag = 0) = 0;
00146 
00147 signals:
00148 
00155     void showProgress(int aMaximum, const QString& aLabel);
00156 
00161     void updateProgressMaximum(int aMaximum);
00162 
00167     void updateProgressValue(int aValue);
00168 
00173     void updateProgressLabel(const QString& aLabel);
00174 
00179     void hideProgress();
00180 
00185     void itemSynced(const QVariant& aKey);
00186 
00191     void itemRejected(const QVariant& aKey);
00192 };
00193 
00194 #endif // BPSROBOT_H