~ubuntu-branches/ubuntu/wily/ginkgocadx/wily-proposed

« back to all changes in this revision

Viewing changes to src/cadxcore/eventos/mensajes.h

  • Committer: Bazaar Package Importer
  • Author(s): Andreas Tille
  • Date: 2011-05-02 08:09:26 UTC
  • Revision ID: james.westby@ubuntu.com-20110502080926-bql5wep49c7hg91t
Tags: upstream-2.4.1.1
Import upstream version 2.4.1.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
*  
 
3
*  $Id: mensajes.h 3698 2011-04-14 12:38:49Z carlos $
 
4
*  Ginkgo CADx Project
 
5
*
 
6
*  Copyright 2008-10 MetaEmotion S.L. All rights reserved.
 
7
*  http://ginkgo-cadx.com
 
8
*
 
9
*  This file is licensed under LGPL v3 license.
 
10
*  See License.txt for details
 
11
*
 
12
*/
 
13
#pragma once
 
14
 
 
15
namespace GNC {
 
16
        namespace GCS {
 
17
                namespace Eventos {
 
18
 
 
19
                        //este evento servir� para lanzar mensajes al usuario, en el status bar y en un futuro en el popup window q sea
 
20
                        class EXTAPI EventoMensajes : public GNC::GCS::Eventos::IEvento
 
21
                        {
 
22
                        public:
 
23
                                typedef enum {
 
24
                                        StatusMessage,
 
25
                                        PopUpMessage
 
26
                                } TipoEventoMensajes;
 
27
 
 
28
                                typedef enum {
 
29
                                        Informacion,
 
30
                                        Aviso,
 
31
                                        Error
 
32
                                } TipoGravedad;
 
33
 
 
34
                                EventoMensajes(GNC::GCS::IVista* pVista, TipoEventoMensajes tipo = StatusMessage, TipoGravedad gravedad = Informacion): GNC::GCS::Eventos::IEvento(ginkgoEVT_Core_MensajesUsuario,0,100,pVista){
 
35
                                        m_Nombre = "Mensajes";  
 
36
                                        m_tipo = tipo;
 
37
                                        m_gravedad = gravedad;
 
38
                                        m_sincrono = true;
 
39
                                }
 
40
 
 
41
                                EventoMensajes(GNC::GCS::IVista* pVista,const std::string& mensaje, TipoEventoMensajes tipo = StatusMessage, bool sincrono = true, TipoGravedad gravedad = Informacion) : GNC::GCS::Eventos::IEvento(ginkgoEVT_Core_MensajesUsuario,0,100,pVista)
 
42
                                {
 
43
                                        m_Nombre = "Mensajes";
 
44
                                        m_Mensaje = mensaje;
 
45
                                        m_tipo = tipo;
 
46
                                        m_gravedad = gravedad;
 
47
                                        m_sincrono = sincrono;
 
48
                                }
 
49
 
 
50
                                ~EventoMensajes()
 
51
                                {
 
52
                                }
 
53
 
 
54
                                std::string& GetMensaje(){
 
55
                                        return m_Mensaje;
 
56
                                }
 
57
 
 
58
                                TipoEventoMensajes GetTipo(){
 
59
                                        return m_tipo;
 
60
                                }
 
61
 
 
62
                                void SetGravedad(TipoGravedad gravedad) {
 
63
                                        m_gravedad = gravedad;
 
64
                                }
 
65
 
 
66
                                TipoGravedad GetGravedad() {
 
67
                                        return m_gravedad;
 
68
                                }
 
69
 
 
70
                                bool IsSincronoConLaInterfaz() {
 
71
                                        return m_sincrono;
 
72
                                }
 
73
 
 
74
                                virtual void pushInfo(std::ostream& out) const {
 
75
                                        out << "Mensaje: " << m_Mensaje;
 
76
                                }
 
77
 
 
78
                        protected:
 
79
                                std::string        m_Mensaje;
 
80
                                TipoEventoMensajes m_tipo;
 
81
                                TipoGravedad       m_gravedad;
 
82
                                bool               m_sincrono;
 
83
                        };
 
84
                }
 
85
        }
 
86
}