recents.hpp

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * recents.cpp : Recents MRL (menu)
00003  *****************************************************************************
00004  * Copyright © 2006-2008 the VideoLAN team
00005  * $Id: 88531ff1e28e1119a17adbc49779cd0d56524d21 $
00006  *
00007  * Authors: Ludovic Fauvet <etix@l0cal.com>
00008  *
00009  * This program is free software; you can redistribute it and/or modify
00010  * it under the terms of the GNU General Public License as published by
00011  * the Free Software Foundation; either version 2 of the License, or
00012  * ( at your option ) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
00022  *****************************************************************************/
00023 
00024 #ifndef QVLC_RECENTS_H_
00025 #define QVLC_RECENTS_H_
00026 
00027 #include "qt4.hpp"
00028 
00029 #include <QObject>
00030 class QStringList;
00031 class QRegExp;
00032 class QSignalMapper;
00033 
00034 #define RECENTS_LIST_SIZE 10
00035 
00036 class RecentsMRL : public QObject
00037 {
00038     Q_OBJECT
00039 
00040 public:
00041     static RecentsMRL* getInstance( intf_thread_t* p_intf )
00042     {
00043         if(!instance)
00044             instance = new RecentsMRL( p_intf );
00045         return instance;
00046     }
00047     static void killInstance()
00048     {
00049         delete instance;
00050         instance = NULL;
00051     }
00052 
00053     void addRecent( const QString & );
00054     QStringList recents();
00055 
00056     QSignalMapper *signalMapper;
00057 
00058 private:
00059     RecentsMRL( intf_thread_t* _p_intf );
00060     virtual ~RecentsMRL();
00061 
00062     static RecentsMRL *instance;
00063 
00064     intf_thread_t *p_intf;
00065     QStringList   *stack;
00066     QRegExp       *filter;
00067     bool          isActive;
00068 
00069     void load();
00070     void save();
00071 public slots:
00072     void clear();
00073 };
00074 
00075 #endif

Generated on Tue May 25 08:04:58 2010 for VLC by  doxygen 1.5.6