~ubuntu-branches/debian/sid/kdevelop/sid

« back to all changes in this revision

Viewing changes to parts/filecreate/filecreate_typechooser.h

  • Committer: Bazaar Package Importer
  • Author(s): Jeremy Lainé
  • Date: 2006-05-23 18:39:42 UTC
  • Revision ID: james.westby@ubuntu.com-20060523183942-hucifbvh68k2bwz7
Tags: upstream-3.3.2
Import upstream version 3.3.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __FILECREATE_TYPECHOOSER_H__
 
2
#define __FILECREATE_TYPECHOOSER_H__
 
3
 
 
4
#include "filecreate_typechoosersig.h"
 
5
 
 
6
#include <kdebug.h>
 
7
 
 
8
class FileCreatePart;
 
9
 
 
10
namespace FileCreate {
 
11
 
 
12
class FileType;
 
13
 
 
14
class TypeChooser  {
 
15
  
 
16
public:
 
17
 
 
18
  TypeChooser(FileCreatePart * part) : m_part(part), m_current(NULL) {
 
19
    m_signaller = new Signaller;
 
20
  }
 
21
  virtual ~TypeChooser() { delete m_signaller; }
 
22
 
 
23
  virtual void setPart(FileCreatePart * part) { m_part = part; }
 
24
  virtual FileCreatePart * part() const { return m_part; }
 
25
  virtual void refresh() = 0;
 
26
  virtual void setCurrent(const FileType * current) = 0;
 
27
  virtual const FileType * current() const { return m_current; }
 
28
 
 
29
  virtual void filetypeSelected(const FileType * filetype) {
 
30
    m_current = filetype;
 
31
    kdDebug(9034) << "type selected: about to signal" << endl;
 
32
    if (filetype) m_signaller->signal(filetype);
 
33
    kdDebug(9034) << "type selected: done signal" << endl;
 
34
  }
 
35
 
 
36
  const Signaller * signaller() const { return m_signaller; }  
 
37
  
 
38
protected:
 
39
  FileCreatePart * m_part;
 
40
  Signaller * m_signaller;
 
41
  const FileType * m_current;
 
42
 
 
43
};
 
44
 
 
45
}
 
46
 
 
47
#endif