From 62717b85b3206b178488fbb80925944d31534d46 Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Sat, 2 Apr 2016 01:57:39 +0300 Subject: [PATCH] In progress... --- src/main.vala | 40 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 36 insertions(+), 4 deletions(-) diff --git a/src/main.vala b/src/main.vala index 25e83b1..5d5e9b9 100644 --- a/src/main.vala +++ b/src/main.vala @@ -34,12 +34,44 @@ public class PluginDataExample : PluginData { * Any abstract method realization for PluginData. */ public override string get_readable_name () { - //stdout.puts ("PluginDataExample.get_readable_name () called\n"); - //stdout.puts ("Call IHostCore.get_cache_dir () from PluginDataExample:\n "); - //var cache_dir = (host as IHostCore).get_cache_dir (); - //stdout.printf ("cache_dir = %s\n", cache_dir); return _("Data Example"); } + + /** + * transfer string data + */ + public string get_string_data (string id) { + switch (id) { + case "SampleRequest": return "Sample Answer"; + case "AnotherRequest": return "Another Answer"; + case "Manual.SampleRequest": return "Manual Sample Answer"; + case "MainChart": + var cache_dir = (host as IHostCore).get_cache_dir (); + // TODO: save picture in path: cache_dir + "MainChart.png"; + + return "MainChart"; + } + return ""; + } + + /** + * transfer array1D data + */ + public string[] get_array1d_data (string id) { + return { "A1d", "B1d", "C1d", "D1d", "E1d" }; + } + + /** + * transfer array1D data + */ + public string[,] get_array2d_data (string id) { + return { { "A2d", "B2d", "C2d", "D2d", "E2d"}, + { "F2d", "G2d", "H2d", "I2d", "J2d"}, + { "K2d", "L2d", "M2d", "N2d", "O2d"}, + { "P2d", "Q2d", "R2d", "S2d", "T2d"}, + { "U2d", "V2d", "W2d", "X2d", "Y2d"}, + }; + } } [ModuleInit]