Logo Search packages:      
Sourcecode: ecawave version File versions  Download package

qefilenameinput.h

#ifndef INCLUDED_QEFILENAMEINPUT_H
#define INCLUDED_QEFILENAMEINPUT_H

#include <string>
#include <qlineedit.h>

#include "qeinput.h"

class QBoxLayout;
class QLineEdit;

/**
 * Filename input with browsing
 */
00015 class QEFilenameInput : public QEInput {
  Q_OBJECT

 public:

  /**
   * File browser modes. 'browse_existing' only allows to select
   * existing files, while in 'browse_new' mode, all filenames are
   * accepted.
   */
  enum {
    browse_existing,
    browse_any
  };

  QEFilenameInput (int mode, QWidget* parent = 0, const char *name = 0);

  /**
   * Current filename
   */
  const std::string& result_filename(void) const;

  /**
   * Get current browsing directory 
   */
00040   const std::string& current_dir(void) const { return(current_dir_rep); }

  /**
   * Sets the initial file name
   */
00045   void set_filename(const std::string& name) { filenameinput->setText(name.c_str()); }

  /**
   * Sets the starting directory for browsing
   */
00050   void set_current_dir(const std::string& newpath) { current_dir_rep = newpath; }

public slots:

  void button_browse(void);

  /** 
   * Fetches result data from widgets
   */
00059  virtual void update_results(void) { }

signals:

  /** 
   * Emitted when some file has been selected
   */
  void file_selected(void);

 public:

  QSize sizeHint(void) const;

 private:

  /**
   * Creates and initializes widget layout
   */
  void init_layout(void);

  QBoxLayout* filename;
  QLineEdit* filenameinput;
  QAccel *accel;
  int mode_rep;
  mutable std::string filename_rep;
  std::string current_dir_rep;
};

#endif

Generated by  Doxygen 1.6.0   Back to index