Changeset 71:415b45c71663 in SMSSender


Ignore:
Timestamp:
Feb 7, 2010 10:17:45 PM (8 years ago)
Author:
Sämy Zehnder <saemy.zehnder@…>
Branch:
3.0
Convert:
svn:3639001d-8e34-449c-bb86-3782b86c4877/branches/3.0@70
Message:
  • Reorganized all the libraries. libinterfaces and libgateways are removed now and libdatatypes contains now all these files.
Files:
68 added
8 deleted
26 edited

Legend:

Unmodified
Added
Removed
  • gateways/SwisscomXtraZone/SwisscomXtraZone.pro

    r65 r71  
    1111LIBS += -L../../lib/
    1212# Attend the order!
    13 LIBS += -linterfaces \
    14     -lgateway \
    15     -linterfaces \
    16     -ldatatypes \
     13LIBS += -ldatatypes \
    1714    -lutils
    18 INCLUDEPATH += app \
    19     ../../lib/libinterfaces/src/exceptions/ \
    20     ../../lib/libinterfaces/src/business/ \
    21     ../../lib/libinterfaces/src/ui/ \
    22     ../../lib/libinterfaces/src/ \
    23     ../../lib/libgateway/src/exceptions/ \
    24     ../../lib/libgateway/src/business/ \
    25     ../../lib/libgateway/src/persistence/ \
    26     ../../lib/libdatatypes/src/business \
     15INCLUDEPATH += src/ \
     16    ../../lib/libdatatypes/src/interfaces \
     17    ../../lib/libdatatypes/src/exceptions \
    2718    ../../lib/libdatatypes/src \
    2819    ../../lib/libutils/src/
  • gateways/SwisscomXtraZone/src/business/BCAccount.cpp

    r62 r71  
    1414#include <QDebug>
    1515
    16 #include <StdExceptions.h>
    17 #include <LoginAccountExceptions.h>
     16#include <stdexceptions.h>
     17#include <loginaccountexceptions.h>
    1818
    1919#include <snumber.h>
     
    2222#include "BCGateway.h"
    2323#include "validation/BCAccountValidator.h"
    24 #include "../persistence/DAAccountStorageOfficer.h"
     24#include "persistence/DAAccountStorageOfficer.h"
    2525
    2626namespace SwisscomXtraZone {
     
    3131    , MAX_MOBILE(10)
    3232{
    33     httpHelper_     = new HttpHelper();
     33    httpHelper_     = new SHttpHelper();
    3434
    3535    /* Insert the swisscom-mobile.ch certificate to allow propper loading of the websites... */
     
    5858
    5959
    60 ILoginGateway* BCAccount::gateway() const {
     60AbstractLoginGateway* BCAccount::gateway() const {
    6161    return BCGateway::instance();
    6262}
  • gateways/SwisscomXtraZone/src/business/BCAccount.h

    r43 r71  
    99#define SWISSCOMXTRAZONE_BCACCOUNT_H_
    1010
    11 #include <AbstractLoginAccount.h>
     11#include <abstract/abstractloginaccount.h>
    1212#include <persistence/istorage.h>
    1313
    14 #include <HttpHelper.h>
     14#include <shttphelper.h>
    1515
    1616namespace SwisscomXtraZone {
     
    2424
    2525    /* ILoginAccount */
    26     virtual ILoginGateway*   gateway() const;
     26    virtual AbstractLoginGateway*   gateway() const;
    2727
    2828    /* IAccount */
     
    4141
    4242private:
    43     HttpHelper*    httpHelper_;
     43    SHttpHelper* httpHelper_;
    4444
    4545    const int MAX_MOBILE;
  • gateways/SwisscomXtraZone/src/business/BCGateway.cpp

    r56 r71  
    99
    1010#include "BCAccount.h"
    11 #include "../ui/vcsettingswidget.h"
     11#include "ui/vcsettingswidget.h"
    1212
    1313namespace SwisscomXtraZone {
    1414
    15 ILoginGateway* BCGateway::instance_ = NULL;
    16 ILoginGateway* BCGateway::instance(){
     15AbstractLoginGateway* BCGateway::instance_ = NULL;
     16AbstractLoginGateway* BCGateway::instance(){
    1717    return instance_ ? instance_ : (instance_ = new BCGateway);
    1818}
  • gateways/SwisscomXtraZone/src/business/BCGateway.h

    r56 r71  
    99#define SWISSCOMXTRAZONE_BCGATEWAY_H_
    1010
    11 #include <AbstractLoginGateway.h>
     11#include <abstract/abstractlogingateway.h>
    1212#include <persistence/istorage.h>
    1313
     
    2323
    2424public:
    25     static ILoginGateway*  instance();
     25    static AbstractLoginGateway*  instance();
    2626
    2727    /* IGateway */
     
    5555
    5656private:
    57     static ILoginGateway* instance_;
     57    static AbstractLoginGateway* instance_;
    5858
    5959    const int SHORTSMS_LENGTH;
  • gateways/SwisscomXtraZone/src/business/validation/BCAccountValidator.cpp

    r42 r71  
    1313
    1414IValidationResult* BCAccountValidator::validate() const {
    15     IValidationResult* result = BCLoginAccountValidator::validate();
     15    IValidationResult* result = SLoginAccountValidator::validate();
    1616
    1717    if (account()->username().contains(QRegExp("[^\\d]")) || (account()->username().length() != 10)) {
  • gateways/SwisscomXtraZone/src/business/validation/BCAccountValidator.h

    r42 r71  
    99#define BCACCOUNTVALIDATOR_H_
    1010
    11 #include "validation/BCLoginAccountValidator.h"
     11#include "validation/sloginaccountvalidator.h"
    1212
    1313namespace SwisscomXtraZone {
    1414
    15 class BCAccountValidator: public BCLoginAccountValidator {
     15class BCAccountValidator: public SLoginAccountValidator {
    1616    Q_OBJECT
    1717
    1818public:
    19     explicit BCAccountValidator(IAccount* account)
    20         : BCLoginAccountValidator(account)
     19    explicit BCAccountValidator(AbstractLoginAccount* account)
     20        : SLoginAccountValidator(account)
    2121    {};
    2222    IValidationResult* validate() const;
  • gateways/SwisscomXtraZone/src/persistence/DAAccountStorageOfficer.h

    r43 r71  
    99#define SWISSCOMXTRAZONE_DAACCOUNTSTORAGEOFFICER_H_
    1010
    11 #include <AbstractLoginAccountStorageOfficer.h>
     11#include <abstract/persistence/abstractloginaccountstorageofficer.h>
    1212
    1313namespace SwisscomXtraZone {
     
    1717
    1818public:
    19     DAAccountStorageOfficer(ILoginAccount* account, IStorage* storage)
     19    DAAccountStorageOfficer(AbstractLoginAccount* account, IStorage* storage)
    2020        : AbstractLoginAccountStorageOfficer(account, storage, "sdo2o0034_k!Qdoc0DiwnfDaLdY<ymWWpovDmwpovDö__dmkosadDLDd.:easdfDSs")
    2121    {};
  • gateways/SwisscomXtraZone/src/ui/vcsettingswidget.cpp

    r43 r71  
    44#include <QMessageBox>
    55
    6 #include <StdExceptions.h>
     6#include <stdexceptions.h>
    77
    8 #include "../business/BCAccount.h"
     8#include "business/BCAccount.h"
    99
    1010namespace SwisscomXtraZone {
  • gateways/SwisscomXtraZone/src/ui/vcsettingswidget.h

    r42 r71  
    55#include "ui_vcsettingswidget.h"
    66
    7 #include <iaccountsettingswidget.h>
     7#include <ui/iaccountsettingswidget.h>
    88
    99namespace SwisscomXtraZone {
  • lib/libdatatypes/datatypes.pro

    r67 r71  
     1# #####################################################################
     2# Automatically generated by qmake (2.01a) Sun Feb 7 17:57:32 2010
     3# #####################################################################
    14VERSION = 2.0.0
    25TEMPLATE = lib
    36CONFIG += staticlib \
    4     thread 
     7    thread
    58DESTDIR = ../
    69TARGET = datatypes
    710QT += core \
    8     network
     11    network \
     12    sql \
     13    gui
    914LIBS += -L../
    1015LIBS += -linterfaces \
    1116    -lutils
    12 INCLUDEPATH += app \
    13     ../libinterfaces/src/exceptions/ \
    14     ../libinterfaces/src/business/ \
    15     ../libinterfaces/src/ \
     17DEPENDPATH += . \
     18    src \
     19    src/abstract \
     20    src/eventmappers \
     21    src/exceptions \
     22    src/interfaces \
     23    src/ui \
     24    src/validation \
     25    src/abstract/persistence \
     26    src/exceptions/persistence \
     27    src/interfaces/persistence
     28INCLUDEPATH += src \
     29    src/interfaces \
    1630    ../libutils/src/
    17 HEADERS += src/business/BCBinary.h \
    18     src/business/BCContact.h \
    19     src/business/BCGroup.h \
     31
     32# Input
     33HEADERS += src/scontact.h \
     34    src/sgroup.h \
     35    src/shttpcookiemanager.h \
     36    src/shttphelper.h \
    2037    src/snumber.h \
    2138    src/sshortcut.h \
    22     src/synchttp.h
    23 SOURCES += src/business/BCBinary.cpp \
    24     src/business/BCContact.cpp \
    25     src/business/BCGroup.cpp \
     39    src/synchttp.h \
     40    src/abstract/abstractaccount.h \
     41    src/abstract/abstractgateway.h \
     42    src/abstract/abstractloginaccount.h \
     43    src/abstract/abstractlogingateway.h \
     44    src/abstract/persistence/abstractaccountstorageofficer.h \
     45    src/abstract/persistence/abstractloginaccountstorageofficer.h \
     46    src/abstract/persistence/abstractstorageofficer.h \
     47    src/exceptions/eexception.h \
     48    src/exceptions/ehttpreadexception.h \
     49    src/exceptions/elibraryloadexception.h \
     50    src/exceptions/eloginaccountloginexception.h \
     51    src/exceptions/eparseexception.h \
     52    src/exceptions/httpexceptions.h \
     53    src/exceptions/libraryexceptions.h \
     54    src/exceptions/loginaccountexceptions.h \
     55    src/exceptions/stdexceptions.h \
     56    src/exceptions/persistence/estoragereadexception.h \
     57    src/exceptions/persistence/estoragewriteexception.h \
     58    src/exceptions/persistence/storageexceptions.h \
     59    src/interfaces/iaccount.h \
     60    src/interfaces/ibinary.h \
     61    src/interfaces/icontact.h \
     62    src/interfaces/igateway.h \
     63    src/interfaces/igroup.h \
     64    src/interfaces/iinterface.h \
     65    src/interfaces/ilibrary.h \
     66    src/interfaces/ilibraryloader.h \
     67    src/interfaces/inumber.h \
     68    src/interfaces/istorable.h \
     69    src/interfaces/istreamable.h \
     70    src/interfaces/ivalidatable.h \
     71    src/interfaces/ivalidationresult.h \
     72    src/interfaces/ivalidator.h \
     73    src/interfaces/persistence/iaccountmanager.h \
     74    src/interfaces/persistence/icontactmanager.h \
     75    src/interfaces/persistence/igroupmanager.h \
     76    src/interfaces/persistence/isettings.h \
     77    src/interfaces/persistence/istorage.h \
     78    src/interfaces/persistence/istorageofficer.h \
     79    src/eventmappers/eventinterfaces.h \
     80    src/eventmappers/saccounteventmapper.h \   
     81    src/eventmappers/scontacteventmapper.h \
     82    src/eventmappers/sgroupeventmapper.h \
     83    src/eventmappers/sloginaccounteventmapper.h \
     84    src/ui/iaccountsettingswidget.h \
     85    src/validation/sloginaccountvalidator.h \
     86    src/validation/sstdaccountvalidator.h \
     87    src/validation/svalidationresult.h
     88SOURCES += src/scontact.cpp \
     89    src/sgoup.cpp \
     90    src/shttpcookiemanager.cpp \
     91    src/shttphelper.cpp \
    2692    src/snumber.cpp \
    27     src/sshortcut.cpp
    28 FORMS +=
    29 RESOURCES +=
     93    src/sshortcut.cpp \
     94    src/abstract/abstractaccount.cpp \
     95    src/abstract/abstractgateway.cpp \
     96    src/abstract/abstractloginaccount.cpp \
     97    src/abstract/abstractlogingateway.cpp \
     98    src/abstract/persistence/abstractaccountstorageofficer.cpp \
     99    src/abstract/persistence/abstractloginaccountstorageofficer.cpp \
     100    src/abstract/persistence/abstractstorageofficer.cpp \
     101    src/interfaces/iaccount.cpp \
     102    src/interfaces/inumber.cpp \
     103    src/validation/sloginaccountvalidator.cpp \
     104    src/validation/sstdaccountvalidator.cpp \
     105    src/validation/svalidationresult.cpp
  • lib/libdatatypes/src/snumber.cpp

    r56 r71  
    1111#include <QStringList>
    1212
    13 #include <StdExceptions.h>
     13#include "exceptions/stdexceptions.h"
    1414
    1515#include <typeconvert.h>
  • lib/libutils/src/strutils.cpp

    r41 r71  
    1515
    1616bool StrUtils::isPositiveNumeric(const QString& s){
    17     QString test(s);
    18     return test.remove(QRegExp("^\\d+$")) == "";
     17    bool ok;
     18    int val = s.toInt(&ok);
     19    return ok && val >= 0;
    1920}
    2021
    2122bool StrUtils::isNegativeNumeric(const QString& s){
    22     QString test(s);
    23     return test.remove(QRegExp("^-\\d+$")) == "";
     23    bool ok;
     24    int val = s.toInt(&ok);
     25    return ok && val <= 0;
    2426}
  • smssender.pro

    r65 r71  
    11VERSION = 3.0.0
    22CONFIG += qt \
    3     thread 
     3    thread
    44TARGET = smssender-bin
    55QT += core \
     
    99LIBS += -lcrypto++ \
    1010    -ldatatypes \
    11     -lutils \
    12     -linterfaces
    13 INCLUDEPATH += app \
     11    -lutils
     12INCLUDEPATH += src/ \
    1413    src/ui/components \
    15     lib/libinterfaces/src/business \
    16     lib/libinterfaces/src/exceptions \
    17     lib/libinterfaces/src \
    18     lib/libdatatypes/src/business \
     14    lib/libdatatypes/src/interfaces \
     15    lib/libdatatypes/src/exceptions \
    1916    lib/libdatatypes/src \
    2017    lib/libutils/src \
    21     include
     18    include/
    2219HEADERS += src/ui/models/accounttreemodel.h \
    2320    src/ui/models/loadedaccountmodel.h \
     
    4643    src/persistence/DAGroupManager.h \
    4744    src/business/BCGroupManager.h \
    48     src/ui/UIHelper.h \
    4945    src/ui/VCEditContact/vceditcontact.h \
    5046    src/persistence/DASettings.h \
     
    8278    src/persistence/DAGroupManager.cpp \
    8379    src/business/BCGroupManager.cpp \
    84     src/ui/UIHelper.cpp \
    8580    src/ui/VCEditContact/vceditcontact.cpp \
    8681    src/persistence/DASettings.cpp \
  • src/business/BCAccountLoadManager.h

    r36 r71  
    1313
    1414#include <iaccount.h>
     15#include <stdexceptions.h>
    1516
    1617#include "BCAccountLoadThread.h"
  • src/business/BCAccountLoadThread.h

    r40 r71  
    77#include <iaccount.h>
    88
    9 #include <StdExceptions.h>
     9#include <stdexceptions.h>
    1010
    1111enum AccountLoadState {
  • src/business/BCAccountManager.cpp

    r67 r71  
    100100}
    101101void BCAccountManager::accountDataChanged() {
    102     AccountEventMapper* eventMapper = qobject_cast<AccountEventMapper*>(sender());
     102    SAccountEventMapper* eventMapper = static_cast<SAccountEventMapper*>(sender()); //TODO: this is wrong... (sender() is not the eventManager)
    103103    IAccount* account = eventMapper->account();
    104104    Q_ASSERT(account);
  • src/business/BCContactManager.cpp

    r56 r71  
    9999}
    100100void BCContactManager::contactDataChanged() {
    101     IContact* contact= static_cast<ContactEventMapper*>(sender())->contact();
     101    IContact* contact= static_cast<SContactEventMapper*>(sender())->contact();
    102102    Q_ASSERT(contact);
    103103    emit contactUpdated(contact);
  • src/business/BCGroupManager.cpp

    r43 r71  
    8888}
    8989void BCGroupManager::groupDataChanged() {
    90     IGroup* group= static_cast<GroupEventMapper*>(sender())->group();
     90    IGroup* group= static_cast<SGroupEventMapper*>(sender())->group();
    9191    Q_ASSERT(group);
    9292    emit groupUpdated(group);
  • src/business/BCLibraryLoader.cpp

    r66 r71  
    1515
    1616#include <ilibrary.h>
    17 #include <LibraryExceptions.h>
     17#include <libraryexceptions.h>
    1818
    1919BCLibraryLoader* BCLibraryLoader::instance_=0;
  • src/business/BusinessFactory.cpp

    r43 r71  
    88#include "BusinessFactory.h"
    99
    10 #include "BCContact.h"
    11 #include "BCGroup.h"
    12 
    1310BusinessFactory* BusinessFactory::instance_=0;
    1411BusinessFactory* BusinessFactory::instance(){
    1512    return instance_ ? instance_ : (instance_ = new BusinessFactory);
    1613}
    17 
    18 IContact* BusinessFactory::getContactInstance(){
    19     return new BCContact;
    20 }
    21 
    22 IGroup* BusinessFactory::getGroupInstance(){
    23     return new BCGroup;
    24 }
  • src/business/BusinessFactory.h

    r43 r71  
    99#define BUSINESSFACTORY_H_
    1010
    11 #include <icontact.h>
    12 #include <igroup.h>
    13 
    1411class BusinessFactory {
    1512
    1613public:
    1714    static BusinessFactory* instance();
    18 
    19     IContact*  getContactInstance();
    20     IGroup*    getGroupInstance();
    2115
    2216protected:
  • src/persistence/storage/DAAccountListManager.cpp

    r44 r71  
    1111
    1212#include <igateway.h>
    13 #include <StorageExceptions.h>
     13#include <persistence/storageexceptions.h>
    1414#include <typeconvert.h>
    1515
  • src/persistence/storage/DAStorage.cpp

    r63 r71  
    1717#include <iaccount.h>
    1818
    19 #include <StdExceptions.h>
    20 #include <StorageExceptions.h>
    21 
    22 #include <BCContact.h>
    23 #include <BCBinary.h>
    24 #include <BCGroup.h>
     19#include <stdexceptions.h>
     20#include <persistence/storageexceptions.h>
     21
     22#include <scontact.h>
     23#include <sgroup.h>
    2524#include <sshortcut.h>
    26 #include "../../business/BCSettings.h"
    27 #include "../../business/BCContactManager.h"
     25#include "business/BCSettings.h"
     26#include "business/BCContactManager.h"
    2827
    2928#include <typeconvert.h>
     
    127126
    128127IContact* DAStorage::readContact(int contactId){
    129     IContact* contact = new BCContact();
     128    IContact* contact = new SContact();
    130129
    131130    QSqlQuery query = createQuery();
     
    150149
    151150IGroup* DAStorage::readGroup(int groupId){
    152     IGroup* group = new BCGroup();
     151    IGroup* group = new SGroup();
    153152
    154153    QSqlQuery query = createQuery();
  • src/ui/VCAddressBook/vcaddressbook.cpp

    r55 r71  
    1111#include "../UIHelper.h"
    1212
     13#include <scontact.h>
     14#include <sgroup.h>
    1315#include <snumber.h>
    1416#include "../../business/BCContactManager.h"
    1517#include "../../business/BCGroupManager.h"
    16 #include "../../business/BusinessFactory.h"
    1718
    1819#include <typeconvert.h>
     
    167168/* Contacts */
    168169void VCAddressBook::on_btnAddContact_clicked(){
    169     editContact(BusinessFactory::instance()->getContactInstance());
     170    editContact(new SContact());
    170171}
    171172
     
    202203
    203204void VCAddressBook::on_btnAddGroup_clicked(){
    204     editGroup(BusinessFactory::instance()->getGroupInstance());
     205    editGroup(new SGroup());
    205206}
    206207
  • src/ui/VCMain/vcmain.cpp

    r67 r71  
    99#include <algorithm>
    1010
     11#include <scontact.h>
    1112#include <snumber.h>
    1213#include <typeconvert.h>
     
    308309                addRecipient(recipient);
    309310            } else {
    310                 IContact* recipient = BusinessFactory::instance()->getContactInstance();
     311                IContact* recipient = new SContact();
    311312                recipient->setNumber(number);
    312313
Note: See TracChangeset for help on using the changeset viewer.