/********************************* CMDI_Documents.h ****************************
                                                                                
    Project: MedinTux                                                            
    Copyright (C) 2005 by Roland Sevin  and Data Medical Design            
    E-Mail: data.medical.design@club-internet.fr                                 
                                                                                 
    This program is free software; you can redistribute it and/or modify         
    it under the terms of the CeCILL Version 1 du 21/06/2004                     
    License (GPL compatible)                                                     
                               http://www.cecill.info/                           
    as published by :                                                            
                                                                                 
    Commissariat � l'Energie Atomique                                            
    - CEA,                                                                       
                             31-33 rue de la F�d�ration, 75752 PARIS cedex 15.   
                             FRANCE                                              
    Centre National de la Recherche Scientifique                                 
    - CNRS,                                                                      
                             3 rue Michel-Ange, 75794 Paris cedex 16.            
                             FRANCE                                              
    Institut National de Recherche en Informatique et en Automatique             
    - INRIA,                                                                     
                             Domaine de Voluceau, Rocquencourt, BP 105, 78153    
                             FRANCE                                              
                                                                                 
          This program is distributed in the hope that it will be useful,        
          but WITHOUT ANY WARRANTY; without even the implied warranty of         
          MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                   
          CeCILL  License (GPL compatible) for more details.                     
                                                                                 
 **********************************************************************************/

#ifndef CMDI_DOCUMENTS_H
#define CMDI_DOCUMENTS_H

/**
	@author Eric Maeker <eric.maeker@free.fr> et Sevin Roland <roland-sevin@medintux.org>
*/
#include "CMDI_Generic.h"
#include "C_RubDocuments.h"
#include <qvbox.h>

class CPrtQListBoxItem;
//====================================== CMDI_Documents =======================================================
class CMDI_Documents : public CMDI_Generic
{

    Q_OBJECT
public:

    static  QString      S_GetRubName(){return QString("Documents");};
    static  int          S_GetType() {return 20080000;};      //#define TYP_DOCUMENTS  20080000

    CMDI_Documents( QWidget* parent,      const char* name,    int wflags , CMoteurBase *pCMoteurBase, RUBREC_LIST  *pRubList,
                    const char* num_GUID, const char* id_doss, const char* dossNom, const char* dossPrenom, const char* user);
   ~CMDI_Documents();


    int          GetCurrent_RubList_ID();
    RUBREC_LIST::iterator Current_RubList_Iterator();
    int          initData();
    void         IfModified_SaveInRubList();
    int          SetCurentDocByPrimkey(const QString &pk);
    MyEditText  *GetCurrentEditor();
    void         SetInterfaceOnDroits(const QString &droits);
    void         DoActionWithThisDocument(const QString &verbe, int typ, const char *path =0, const QDateTime *pQDateTime=0, const QString *libelle=0, const QString *subType=0);
    void         AddNewDocument(const QString &strData, int typ, const char *path =0, const QDateTime *pQDateTime=0, const QString *libelle=0, const QString *subType=0);

    void         ChangeCurrentComboBoxItemName(const QString &name);
    CPrtQListBoxItem    *GetRubListComboBox();
public slots:
    void RubOnUserChange(const char*user, const char*sign_user);
    //............. appelé par DrTux pour mettre à jour les ..................
    //              données en fonction de l'identité du patient
    void OnIdentChange(const char* num_GUID,          const char* id_doss,
                       const char* dossNom ,          const char* dossPrenom );
    void SetModifiableState(int state);
    void OnPrint();
    void On_pushButtonAppend();
    void Slot_OnGlossaireFileClicked(const char *file , int typ_rub);
    
public:
    C_RubDocuments  *m_pC_RubDocuments;
    QString          m_LastPath;
signals:
    void message(const QString&, int );
    void Sign_RubIsDeleted(const char* name);

private:

};
#endif   // CMDI_IDENT_H

