~ubuntu-branches/ubuntu/saucy/sflphone/saucy

« back to all changes in this revision

Viewing changes to sflphone-common/src/history/historymanager.h

  • Committer: Bazaar Package Importer
  • Author(s): Francois Marier
  • Date: 2010-12-24 16:33:55 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20101224163355-tkvvikqxbrbav6up
Tags: 0.9.11-1
* New upstream release
* Add new build dependencies on libwebkit-dev and libyaml-dev

* Bump Standards-Version up to 3.9.1
* Bump debhelper compatibility to 8
* Patch another typo in the upstream code (lintian notice)

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
#ifndef _HISTORY_MANAGER
33
33
#define _HISTORY_MANAGER
34
34
 
35
 
#include "historyitem.h" 
 
35
#include "historyitem.h"
36
36
#include <global.h>
37
37
#include <user_cfg.h>
38
38
 
39
39
#define DAY_UNIX_TIMESTAMP      86400   // Number of seconds in one day: 60 x 60 x 24
40
40
 
41
 
typedef std::map <std::string, HistoryItem*> HistoryItemMap; 
 
41
typedef std::map <std::string, HistoryItem*> HistoryItemMap;
42
42
 
43
 
class HistoryManager {
 
43
class HistoryManager
 
44
{
44
45
 
45
46
    public:
46
47
        /*
56
57
        /**
57
58
         *@param path  A specific file to use; if empty, use the global one
58
59
         *
59
 
         *@return int The number of history items succesfully loaded
 
60
         *@return int The number of history items successfully loaded
60
61
         */
61
62
        int load_history (int limit, std::string path="");
62
63
 
95
96
        inline void set_history_path (std::string filename) {
96
97
            _history_path = filename;
97
98
        }
98
 
    
 
99
 
99
100
        /*
100
101
         *@return int   The number of items found in the history file
101
102
         */
108
109
        int set_serialized_history (std::map <std::string, std::string> history, int limit);
109
110
 
110
111
    private:
111
 
        inline int get_unix_timestamp_equivalent (int days)
112
 
        {
 
112
        inline int get_unix_timestamp_equivalent (int days) {
113
113
            return days * DAY_UNIX_TIMESTAMP;
114
114
        }
115
 
        
116
 
        int getConfigInt(const std::string& section, const std::string& name, Conf::ConfigTree *history_list);
117
 
        std::string getConfigString(const std::string& section, const std::string& name, Conf::ConfigTree *history_list);
 
115
 
 
116
        int getConfigInt (const std::string& section, const std::string& name, Conf::ConfigTree *history_list);
 
117
        std::string getConfigString (const std::string& section, const std::string& name, Conf::ConfigTree *history_list);
118
118
 
119
119
        /*
120
120
         * Set the path to the history file
139
139
 
140
140
        /*
141
141
         * The path to the history file
142
 
         */ 
 
142
         */
143
143
 
144
144
        std::string _history_path;
145
145