1 /* logjam - a GTK client for LiveJournal.
2 * Copyright (C) 2000-2003 Evan Martin <evan@livejournal.com>
4 * vim: tabstop=4 shiftwidth=4 noexpandtab :
10 #include "liblj/livejournal.h"
19 typedef struct _JamDoc JamDoc
;
20 typedef struct _JamDocClass JamDocClass
;
22 GType
jam_doc_get_type(void);
23 JamDoc
* jam_doc_new(void);
26 #include <gtk/gtktextbuffer.h>
27 GtkTextBuffer
* jam_doc_get_text_buffer(JamDoc
*doc
);
29 gboolean
jam_doc_append_text (JamDoc
*doc
, const char *text
, const char *encoding
);
31 gboolean
jam_doc_insert_file(JamDoc
*doc
, const char *filename
, const char *encoding
, GError
**err
);
33 gboolean
jam_doc_insert_command_output(JamDoc
*doc
, const char *command
,
34 const char *encoding
, GError
**err
, GtkWindow
*parent
);
37 const char * jam_doc_get_location (JamDoc
*doc
);
38 void jam_doc_set_location(JamDoc
*doc
, const char *location
);
40 char * jam_doc_get_title (JamDoc
*doc
);
41 LJEntry
* jam_doc_get_entry (JamDoc
*doc
);
43 char * jam_doc_get_draftname (JamDoc
*doc
);
45 /* these flags correspond to server-side capabilities;
46 * any document can be saved with a file->save as sort of command. */
47 #define LOGJAM_DOC_CAN_DELETE (1<<0)
48 #define LOGJAM_DOC_CAN_SAVE (1<<1)
49 #define LOGJAM_DOC_CAN_SUBMIT (1<<2)
50 int jam_doc_get_flags (JamDoc
*doc
);
52 void jam_doc_set_dirty (JamDoc
*doc
, gboolean dirty
);
53 gboolean
jam_doc_get_dirty (JamDoc
*doc
);
55 JamAccount
* jam_doc_get_account (JamDoc
*doc
);
56 void jam_doc_set_account (JamDoc
*doc
, JamAccount
* acc
);
58 const char * jam_doc_get_subject(JamDoc
*doc
);
59 void jam_doc_set_subject(JamDoc
*doc
, const char *subject
);
61 LJSecurity
jam_doc_get_security(JamDoc
*doc
);
62 void jam_doc_set_security(JamDoc
*doc
, LJSecurity
*sec
);
64 const char * jam_doc_get_mood(JamDoc
*doc
);
65 void jam_doc_set_mood(JamDoc
*doc
, const char *mood
);
67 void jam_doc_set_moodid(JamDoc
*doc
, int moodid
);
69 const char * jam_doc_get_music(JamDoc
*doc
);
70 void jam_doc_set_music(JamDoc
*doc
, const char *music
);
72 const char * jam_doc_get_taglist(JamDoc
*doc
);
73 void jam_doc_set_taglist(JamDoc
*doc
, const char *taglist
);
75 const char * jam_doc_get_picture(JamDoc
*doc
);
76 void jam_doc_set_picture(JamDoc
*doc
, const char *keyword
);
78 LJCommentsType
jam_doc_get_comments(JamDoc
*doc
);
79 void jam_doc_set_comments(JamDoc
*doc
, LJCommentsType type
);
81 LJScreeningType
jam_doc_get_screening(JamDoc
*doc
);
82 void jam_doc_set_screening(JamDoc
*doc
, LJScreeningType type
);
84 void jam_doc_get_time(JamDoc
*doc
, struct tm
*ptm
);
85 void jam_doc_set_time(JamDoc
*doc
, const struct tm
*ptm
);
87 gboolean
jam_doc_get_backdated(JamDoc
*doc
);
88 void jam_doc_set_backdated(JamDoc
*doc
, gboolean backdated
);
90 gboolean
jam_doc_get_preformatted(JamDoc
*doc
);
91 void jam_doc_set_preformatted(JamDoc
*doc
, gboolean preformatted
);
93 void jam_doc_set_event(JamDoc
*doc
, const char *event
);
95 gchar
* jam_doc_get_usejournal(JamDoc
*doc
);
96 void jam_doc_set_usejournal(JamDoc
*doc
, const gchar
*usejournal
);
98 gboolean
jam_doc_load_file (JamDoc
*doc
, const char *filename
,
99 LJEntryFileType type
, GError
**err
);
100 void jam_doc_load_draft(JamDoc
*doc
, LJEntry
*entry
);
101 void jam_doc_load_entry(JamDoc
*doc
, LJEntry
*entry
);
103 /* these are terrible names. */
104 gboolean
jam_doc_would_save_over_nonxml(JamDoc
*doc
);
105 gboolean
jam_doc_has_save_target(JamDoc
*doc
);
107 gboolean
jam_doc_save (JamDoc
*doc
, JamAccount
*acc
, GError
**err
);
109 /* these emit the "title-changed" signal */
110 gboolean
jam_doc_save_as_file (JamDoc
*doc
,
111 const char *filename
, GError
**err
);
112 gboolean
jam_doc_save_as_draft(JamDoc
*doc
,
113 const char *title
, JamAccount
*acc
, GError
**err
);
116 LJEntryType
jam_doc_get_entry_type(JamDoc
*doc
);
117 gint
jam_doc_get_entry_itemid(JamDoc
*doc
);
120 const char *jam_doc_get_url (JamDoc
*doc
);
121 void jam_doc_set_url (JamDoc
*doc
, const char *url
);
122 void jam_doc_reset_url (JamDoc
*doc
);
124 #define LOGJAM_TYPE_DOC (jam_doc_get_type())
125 #define LOGJAM_DOC(object) (G_TYPE_CHECK_INSTANCE_CAST((object), LOGJAM_TYPE_DOC, JamDoc))
126 #define LOGJAM_DOC_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), LOGJAM_TYPE_DOC, JamDocClass))
129 #endif /* __jam_doc_h__ */